fix: adjust error handling in collector (#622)

This commit is contained in:
Itxaka
2025-09-11 14:26:11 +02:00
committed by GitHub
parent 3d941ad912
commit c9ef4c6ccb

View File

@@ -457,19 +457,12 @@ func fetchRemoteConfig(url string) (*Config, error) {
) )
if err != nil { if err != nil {
// TODO: improve logging // TODO: This keeps the old behaviour but IMHO we should return an error here
fmt.Printf("WARNING: Couldn't fetch config_url: %s", err)
return result, nil return result, nil
} }
if !HasValidHeader(string(body)) { if !HasValidHeader(string(body)) {
// TODO: Print a warning when we implement proper logging // TODO: This keeps the old behaviour but IMHO we should return an error here
if err != nil {
fmt.Printf("No valid header in remote config: %s\n", err.Error())
} else {
fmt.Println("No valid header in remote config")
}
return result, nil return result, nil
} }