http3: fix errors.Is for the Error (#4877)

This commit is contained in:
Marten Seemann
2025-01-15 04:28:11 -08:00
committed by GitHub
parent 155f8a3725
commit a2dccf54ca

View File

@@ -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