Add context to content-server assets download error

This commit is contained in:
chris
2020-08-05 14:47:19 -04:00
committed by Chris Marshall
parent 13d35f17f1
commit f8559befca
6 changed files with 15 additions and 12 deletions

View File

@ -18,6 +18,10 @@ func GetBody(url string) ([]byte, error) {
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return nil, errors.Errorf("cannot get url %q: %v", url, http.StatusText(resp.StatusCode))
}
return ioutil.ReadAll(resp.Body)
}