Skip to content

Commit

Permalink
Don't return ErrBadConn on a network error
Browse files Browse the repository at this point in the history
This has been bad behavior for a long time and no one has brought up
any reasons not to change it in #422. This is a more general fix than
in #728.

Fixes #422
Closes #728
  • Loading branch information
maddyblue committed Mar 25, 2018
1 parent a96442e commit 6e2a335
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ func (c *conn) errRecover(err *error) {
*err = v
}
case *net.OpError:
*err = driver.ErrBadConn
c.bad = true
*err = v
case error:
if v == io.EOF || v.(error).Error() == "remote error: handshake failure" {
*err = driver.ErrBadConn
Expand Down

0 comments on commit 6e2a335

Please sign in to comment.