Fix error message

This commit is contained in:
Galorhallen 2022-01-05 21:58:06 +01:00
parent 479456edc4
commit 2a939bf754

View file

@ -39,7 +39,10 @@ func NewServer(port uint16, clients []*pihole.Client) *Server {
} }
for _, client := range clients { for _, client := range clients {
log.Printf("Received %s from %s\n", <-client.Status, client.GetHostname()) status := <-client.Status
if status.Status == pihole.MetricsCollectionError {
log.Printf("An error occured while contacting %s: %s", client.GetHostname(), status.Err.Error())
}
} }
promhttp.Handler().ServeHTTP(writer, request) promhttp.Handler().ServeHTTP(writer, request)