Skip to content

Commit

Permalink
fixes #819: detect download failures when status code is >= 400
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-garcia committed Feb 20, 2023
1 parent e9e3f41 commit 487f747
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/download/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func (HTTPFetcher) Get(uri string) (io.ReadCloser, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed to download %q", uri)
}
if resp.StatusCode >= 400 {
return nil, errors.Errorf("failed to download %q, status code %d", uri, resp.StatusCode)
}
return resp.Body, nil
}

Expand Down

0 comments on commit 487f747

Please sign in to comment.