pkg/downloader/downloader.go: Add status code check for downloader
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
74593b8bbf
commit
6178bec08b
1 changed files with 3 additions and 0 deletions
|
@ -156,6 +156,9 @@ func DownloadFile(path, url string) {
|
|||
if response.StatusCode == 401 {
|
||||
handleError(errors.New("restriced access, credentials required"))
|
||||
}
|
||||
if response.StatusCode != 200 {
|
||||
handleError(errors.New(response.RawResponse.Status))
|
||||
}
|
||||
response.Close()
|
||||
|
||||
resp, err := req.Get(file.URL, nil)
|
||||
|
|
Loading…
Reference in a new issue