Use formatting print to show underlying error message (#500)

* 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>
This commit is contained in:
Kenny Root 2024-09-27 01:37:38 -07:00 committed by GitHub
parent 541728fa22
commit 9b2eeb0e55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}