Skip to content

Commit

Permalink
Check status code for download
Browse files Browse the repository at this point in the history
  • Loading branch information
choffmeister committed Jan 24, 2023
1 parent 0114925 commit a890ca9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/generator_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func (g DownloadGenerator) Generate() (*GeneratorResult, error) {
if err != nil {
return nil, fmt.Errorf("failed to download %s: %v", g.Url, err)
}
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
return nil, fmt.Errorf("failed to download %s: status code was %d", g.Url, resp.StatusCode)
}

resources, err := splitCombinedKubernetesResources(string(body))
if err != nil {
Expand Down

0 comments on commit a890ca9

Please sign in to comment.