Skip to content

Commit

Permalink
Clean up socker close error check.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Sep 20, 2024
1 parent 5bd45e5 commit 5945bcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/session_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ IncomingLoop:
// Ignore "normal" WebSocket errors.
if !websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway, websocket.CloseNoStatusReceived) {
// Ignore underlying connection being shut down while read is waiting for data.
if e, ok := err.(*net.OpError); !ok || e.Err.Error() != "use of closed network connection" {
var opErr *net.OpError
if !errors.As(err, &opErr) || opErr.Error() != net.ErrClosed.Error() {
s.logger.Debug("Error reading message from client", zap.Error(err))
reason = err.Error()
}
Expand Down

0 comments on commit 5945bcc

Please sign in to comment.