Просмотр исходного кода

Merge branch 'master' of github.com:grafana/grafana

Torkel Ödegaard 9 лет назад
Родитель
Сommit
0964a06ab5
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      pkg/cmd/grafana-cli/services/services.go

+ 5 - 3
pkg/cmd/grafana-cli/services/services.go

@@ -15,14 +15,16 @@ var IoHelper m.IoUtil = IoUtilImp{}
 
 
 func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
 func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
 	fullUrl := repoUrl + "/repo"
 	fullUrl := repoUrl + "/repo"
-	res, _ := goreq.Request{Uri: fullUrl, MaxRedirects: 3}.Do()
-
+	res, err := goreq.Request{Uri: fullUrl, MaxRedirects: 3}.Do()
+	if err != nil {
+		return m.PluginRepo{}, err
+	}
 	if res.StatusCode != 200 {
 	if res.StatusCode != 200 {
 		return m.PluginRepo{}, fmt.Errorf("Could not access %s statuscode %v", fullUrl, res.StatusCode)
 		return m.PluginRepo{}, fmt.Errorf("Could not access %s statuscode %v", fullUrl, res.StatusCode)
 	}
 	}
 
 
 	var resp m.PluginRepo
 	var resp m.PluginRepo
-	err := res.Body.FromJsonTo(&resp)
+	err = res.Body.FromJsonTo(&resp)
 	if err != nil {
 	if err != nil {
 		return m.PluginRepo{}, errors.New("Could not load plugin data")
 		return m.PluginRepo{}, errors.New("Could not load plugin data")
 	}
 	}