Skip to content

Commit c9ef4c6

Browse files
authored
fix: adjust error handling in collector (#622)
1 parent 3d941ad commit c9ef4c6

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

collector/collector.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,19 +457,12 @@ func fetchRemoteConfig(url string) (*Config, error) {
457457
)
458458

459459
if err != nil {
460-
// TODO: improve logging
461-
fmt.Printf("WARNING: Couldn't fetch config_url: %s", err)
460+
// TODO: This keeps the old behaviour but IMHO we should return an error here
462461
return result, nil
463462
}
464463

465464
if !HasValidHeader(string(body)) {
466-
// TODO: Print a warning when we implement proper logging
467-
if err != nil {
468-
fmt.Printf("No valid header in remote config: %s\n", err.Error())
469-
} else {
470-
fmt.Println("No valid header in remote config")
471-
}
472-
465+
// TODO: This keeps the old behaviour but IMHO we should return an error here
473466
return result, nil
474467
}
475468

0 commit comments

Comments
 (0)