pkg/downloader/downloader.go: Add status code check for downloader
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tom Neuber 2023-12-23 23:50:50 +01:00
parent 74593b8bbf
commit 6178bec08b
Signed by: tom
GPG key ID: F17EFE4272D89FF6

View file

@ -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)