Skip to content

Commit

Permalink
chore: handle non-OK status code in lpac download
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Jun 7, 2024
1 parent 75f9e78 commit 9bdae38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/lpac/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func downloadFile(url string, dir string) (string, error) {
if err != nil {
return "", err
}
if resp.StatusCode != http.StatusOK {
return "", errors.New("failed to download lpac: " + resp.Status)
}
defer resp.Body.Close()
filePath := filepath.Join(dir, "lpac.zip")
out, err := os.Create(filePath)
Expand Down

0 comments on commit 9bdae38

Please sign in to comment.