From a2dccf54cacad39e509fa15a42b5b22597f13a44 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 15 Jan 2025 04:28:11 -0800 Subject: [PATCH] http3: fix errors.Is for the Error (#4877) --- http3/error.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http3/error.go b/http3/error.go index b96ebeec..82fdae6a 100644 --- a/http3/error.go +++ b/http3/error.go @@ -33,6 +33,11 @@ func (e *Error) Error() string { return s } +func (e *Error) Is(target error) bool { + t, ok := target.(*Error) + return ok && e.ErrorCode == t.ErrorCode && e.Remote == t.Remote +} + func maybeReplaceError(err error) error { if err == nil { return nil