Skip to content

Commit

Permalink
Merge pull request #115 from piyushsingariya/fix/singariya/minor-1
Browse files Browse the repository at this point in the history
minor fix in the logic for downloading file.
  • Loading branch information
leecalcote committed Oct 6, 2021
2 parents 3e29d3d + 0f96a6f commit f0e5782
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ func DownloadFile(filepath string, url string) error {
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
return fmt.Errorf("failed to get the file %d status code for %s file", resp.StatusCode, url)
}

// Create the file
out, err := os.Create(filepath)
if err != nil {
Expand Down

0 comments on commit f0e5782

Please sign in to comment.