Log the proxy connection failures better

This commit is contained in:
M. Mert Yildiran
2022-12-29 08:01:12 +03:00
parent 1474a7d687
commit 287e3ccf35

View File

@@ -39,9 +39,9 @@ func (connector *Connector) TestConnection(path string) error {
retriesLeft := connector.retries
for retriesLeft > 0 {
if isReachable, err := connector.isReachable(path); err != nil || !isReachable {
log.Debug().Err(err).Msg("Hub is not ready yet!")
log.Debug().Str("url", connector.url).Err(err).Msg("Not ready yet!")
} else {
log.Debug().Msg("Connection test to Hub passed successfully.")
log.Debug().Str("url", connector.url).Msg("Connection test passed successfully.")
break
}
retriesLeft -= 1
@@ -49,7 +49,7 @@ func (connector *Connector) TestConnection(path string) error {
}
if retriesLeft == 0 {
return fmt.Errorf("Couldn't reach the Hub after %d retries!", connector.retries)
return fmt.Errorf("Couldn't reach the URL: %s after %d retries!", connector.url, connector.retries)
}
return nil
}