Skip to content

Commit

Permalink
E: IsClosedOrCanceled check IsTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Dec 1, 2024
1 parent 478265c commit 9f69e7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/exceptions/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Extend(cause error, message ...any) error {
}

func IsClosedOrCanceled(err error) bool {
return IsMulti(err, io.EOF, net.ErrClosed, io.ErrClosedPipe, os.ErrClosed, syscall.EPIPE, syscall.ECONNRESET, context.Canceled, context.DeadlineExceeded)
return IsMulti(err, io.EOF, net.ErrClosed, io.ErrClosedPipe, os.ErrClosed, syscall.EPIPE, syscall.ECONNRESET, context.Canceled, context.DeadlineExceeded) || IsTimeout(err)
}

func IsClosed(err error) bool {
Expand Down

0 comments on commit 9f69e7f

Please sign in to comment.