Skip to content

Commit

Permalink
remove unused error
Browse files Browse the repository at this point in the history
  • Loading branch information
wcsiu committed Apr 10, 2024
1 parent f21bdb1 commit 6f6e6e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client.go
Expand Up @@ -516,7 +516,7 @@ func (c *client) internalConnLost(whyConnLost error) {
DEBUG.Println(CLI, "internalConnLost called")
disDone, err := c.status.ConnectionLost(c.options.AutoReconnect && c.status.ConnectionStatus() > connecting)
if err != nil {
if err == errConnLossWhileDisconnecting || err == errAlreadyHandlingConnectionLoss {
if err == errConnLossWhileDisconnecting {
return // Loss of connection is expected or already being handled
}
ERROR.Println(CLI, fmt.Sprintf("internalConnLost unexpected status: %s", err.Error()))
Expand Down
9 changes: 5 additions & 4 deletions status.go
Expand Up @@ -67,9 +67,11 @@ func (s status) String() string {
}
}

type connCompletedFn func(success bool) error
type disconnectCompletedFn func()
type connectionLostHandledFn func(bool) (connCompletedFn, error)
type (
connCompletedFn func(success bool) error
disconnectCompletedFn func()
connectionLostHandledFn func(bool) (connCompletedFn, error)
)

/* State transitions
Expand Down Expand Up @@ -105,7 +107,6 @@ var (
errAlreadyDisconnected = errors.New("status is already disconnected")
errDisconnectionRequested = errors.New("disconnection was requested whilst the action was in progress")
errDisconnectionInProgress = errors.New("disconnection already in progress")
errAlreadyHandlingConnectionLoss = errors.New("status is already Connection Lost")
errConnLossWhileDisconnecting = errors.New("connection status is disconnecting so loss of connection is expected")
)

Expand Down

0 comments on commit 6f6e6e8

Please sign in to comment.