Skip to content

Commit

Permalink
Merge pull request #307 from cole-miller/expose-leadership-errors
Browse files Browse the repository at this point in the history
driver: Expose leadership-related error codes
  • Loading branch information
cole-miller authored Jul 15, 2024
2 parents 1374ba0 + cdb90da commit 7e27064
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const (
ErrBusyRecovery = 5 | (1 << 8)
ErrBusySnapshot = 5 | (2 << 8)
errIoErr = 10
errIoErrNotLeader = errIoErr | 40<<8
errIoErrLeadershipLost = errIoErr | (41 << 8)
ErrIoErrNotLeader = errIoErr | (40 << 8)
ErrIoErrLeadershipLost = errIoErr | (41 << 8)
errNotFound = 12

// Legacy error codes before version-3.32.1+replication4. Kept here
Expand Down Expand Up @@ -841,9 +841,9 @@ func driverError(log client.LogFunc, err error) error {
fallthrough
case errIoErrLeadershipLostLegacy:
fallthrough
case errIoErrNotLeader:
case ErrIoErrNotLeader:
fallthrough
case errIoErrLeadershipLost:
case ErrIoErrLeadershipLost:
log(client.LogDebug, "leadership lost (%d - %s)", err.Code, err.Description)
return driver.ErrBadConn
case errNotFound:
Expand Down

0 comments on commit 7e27064

Please sign in to comment.