瀏覽代碼

Add missing error check

Brendan Abolivier 7 年之前
父節點
當前提交
0025d65d89
簽署人: Brendan Abolivier <contact@brendanabolivier.com> GPG 金鑰 ID: 8EF1500759F70623
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. 3
    0
      src/grafana/dashboards.go

+ 3
- 0
src/grafana/dashboards.go 查看文件

72
 // response body.
72
 // response body.
73
 func (c *Client) GetDashboardsURIs() (URIs []string, err error) {
73
 func (c *Client) GetDashboardsURIs() (URIs []string, err error) {
74
 	resp, err := c.request("GET", "search", nil)
74
 	resp, err := c.request("GET", "search", nil)
75
+	if err != nil {
76
+		return
77
+	}
75
 
78
 
76
 	var respBody []dbSearchResponse
79
 	var respBody []dbSearchResponse
77
 	if err = json.Unmarshal(resp, &respBody); err != nil {
80
 	if err = json.Unmarshal(resp, &respBody); err != nil {