Skip to content

Commit

Permalink
Use formatting print to show underlying error message (#500)
Browse files Browse the repository at this point in the history
* Use formatting print to show underlying error message

This appears to be a typo where "Println" was used instead of "Printf"

Signed-off-by: Kenny Root <kenny@the-b.org>

* Update collector/collector.go

---------

Signed-off-by: Kenny Root <kenny@the-b.org>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
  • Loading branch information
kruton and mudler authored Sep 27, 2024
1 parent 541728f commit 9b2eeb0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,12 @@ func fetchRemoteConfig(url string) (*Config, error) {

if !HasValidHeader(string(body)) {
// TODO: Print a warning when we implement proper logging
fmt.Println("No valid header in remote config: %w", err)
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
}

Expand Down

0 comments on commit 9b2eeb0

Please sign in to comment.