Skip to content

Commit

Permalink
Merge pull request #558 from TomasVojacek/add_connection_error_to_log
Browse files Browse the repository at this point in the history
log err.error() if ConnectRetry is enabled to assist in identifying the cause of failed connections.
  • Loading branch information
MattBrittan committed Nov 13, 2021
2 parents d978c56 + b3a11bc commit efeb638
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Expand Up @@ -282,7 +282,7 @@ func (c *client) Connect() Token {
conn, rc, t.sessionPresent, err = c.attemptConnection()
if err != nil {
if c.options.ConnectRetry {
DEBUG.Println(CLI, "Connect failed, sleeping for", int(c.options.ConnectRetryInterval.Seconds()), "seconds and will then retry")
DEBUG.Println(CLI, "Connect failed, sleeping for", int(c.options.ConnectRetryInterval.Seconds()), "seconds and will then retry, error:", err.Error())
time.Sleep(c.options.ConnectRetryInterval)

if atomic.LoadUint32(&c.status) == connecting {
Expand Down

0 comments on commit efeb638

Please sign in to comment.