E: IsClosedOrCanceled check IsTimeout

This commit is contained in:
世界 2024-12-01 20:19:37 +08:00
parent 478265cd45
commit 9f69e7f9f7
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -40,7 +40,7 @@ func Extend(cause error, message ...any) error {
} }
func IsClosedOrCanceled(err error) bool { 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 { func IsClosed(err error) bool {