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 {
// TODO: improve logging
fmt.Printf("WARNING: Couldn't fetch config_url: %s", err)
// TODO: This keeps the old behaviour but IMHO we should return an error here
return result, nil
}
if !HasValidHeader(string(body)) {
// TODO: Print a warning when we implement proper logging
if err != nil {
fmt.Printf("No valid header in remote config: %s\n", err.Error())
} else {
fmt.Println("No valid header in remote config")
}
// TODO: This keeps the old behaviour but IMHO we should return an error here
return result, nil
}