Skip to content

Commit

Permalink
Added 200 check to downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
xackery committed Feb 9, 2023
1 parent 3931a1a commit eb22fce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ func (c *Client) downloadPatchFile(entry FileEntry) error {
return fmt.Errorf("download %s: %w", url, err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return fmt.Errorf("download %s responded %d (not 200)", url, resp.StatusCode)
}

_, err = io.Copy(w, resp.Body)
if err != nil {
Expand Down

0 comments on commit eb22fce

Please sign in to comment.