Skip to content

Commit

Permalink
Stop reconnecting on server unavailable error
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Feb 15, 2024
1 parent f546cce commit aed80e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion messagix/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ func (c *Client) Connect() error {
if ctx.Err() != nil {
return
}
if errors.Is(err, CONNECTION_REFUSED_UNAUTHORIZED) || errors.Is(err, CONNECTION_REFUSED_BAD_USERNAME_OR_PASSWORD) {
if errors.Is(err, CONNECTION_REFUSED_UNAUTHORIZED) ||
errors.Is(err, CONNECTION_REFUSED_BAD_USERNAME_OR_PASSWORD) ||
// TODO server unavailable may mean a challenge state, should be checked somehow
errors.Is(err, CONNECTION_REFUSED_SERVER_UNAVAILABLE) {
c.eventHandler(&Event_PermanentError{Err: err})
return
}
Expand Down

0 comments on commit aed80e1

Please sign in to comment.