Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion common/exceptions/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"net/http"
"os"
"strings"
"syscall"
_ "unsafe"

Expand Down Expand Up @@ -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")
}