From 6f1b67844d3998304b83f9eba7a8b77269e8800d Mon Sep 17 00:00:00 2001 From: nightyin Date: Sat, 27 Dec 2025 00:15:43 +0800 Subject: [PATCH] exceptions: classify QUIC StreamError as canceled --- common/exceptions/error.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/exceptions/error.go b/common/exceptions/error.go index 06624bb6..972b7bdf 100644 --- a/common/exceptions/error.go +++ b/common/exceptions/error.go @@ -7,6 +7,7 @@ import ( "net" "net/http" "os" + "strings" "syscall" _ "unsafe" @@ -65,5 +66,14 @@ func IsClosed(err error) bool { } func IsCanceled(err error) bool { - return IsMulti(err, context.Canceled, context.DeadlineExceeded) + return IsMulti(err, context.Canceled, context.DeadlineExceeded) || isCanceledQuicLike(err) +} + +func isCanceledQuicLike(err error) bool { + if err == nil { + return false + } + s := err.Error() + return strings.Contains(s, "canceled by remote with error code 0") || + strings.Contains(s, "canceled by local with error code 0") }