http3: introduce an HTTP/3 error type (#4039)

* http3: introduce an HTTP/3 error type

* http3: use a pointer receiver for the Error
This commit is contained in:
Marten Seemann
2023-09-16 18:57:50 +07:00
committed by GitHub
parent ab1c1be9a9
commit d8cc4cb3ef
7 changed files with 125 additions and 12 deletions

View File

@@ -63,7 +63,8 @@ func (r *body) wasStreamHijacked() bool {
}
func (r *body) Read(b []byte) (int, error) {
return r.str.Read(b)
n, err := r.str.Read(b)
return n, maybeReplaceError(err)
}
func (r *body) Close() error {
@@ -106,7 +107,7 @@ func (r *hijackableBody) Read(b []byte) (int, error) {
if err != nil {
r.requestDone()
}
return n, err
return n, maybeReplaceError(err)
}
func (r *hijackableBody) requestDone() {