fix(cli): improve error handling

closes #6256
This commit is contained in:
bergquist 2016-10-12 22:31:28 +02:00
parent 0f2fa33daf
commit 2e4ca64783

View File

@ -149,6 +149,9 @@ func createRequest(repoUrl string, subPaths ...string) ([]byte, error) {
}
res, err := HttpClient.Do(req)
if res.StatusCode/100 != 2 {
return []byte{}, fmt.Errorf("Api returned invalid status: %s", res.Status)
}
body, err := ioutil.ReadAll(res.Body)
defer res.Body.Close()