diff --git a/pkg/engine/config.go b/pkg/engine/config.go index e2cc1daf..9d2b1e1a 100644 --- a/pkg/engine/config.go +++ b/pkg/engine/config.go @@ -185,9 +185,14 @@ func downloadUpdateConfigFile(urlStr string, existsAlready, initial bool, pat, u return false, err } defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return false, fmt.Errorf("received non-200 HTTP status from %s: %d %s", urlStr, resp.StatusCode, resp.Status) + } + newBytes, err := io.ReadAll(resp.Body) if err != nil { - return false, fmt.Errorf("error downloading config from %s: %v", err) + return false, fmt.Errorf("error downloading config from %s: %v", urlStr, err) } if newBytes == nil { // if initial, this is the last resort, newBytes should be populated