mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
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:
parent
ab1c1be9a9
commit
d8cc4cb3ef
7 changed files with 125 additions and 12 deletions
|
@ -166,9 +166,10 @@ func (w *responseWriter) Write(p []byte) (int, error) {
|
|||
w.buf = w.buf[:0]
|
||||
w.buf = df.Append(w.buf)
|
||||
if _, err := w.bufferedStr.Write(w.buf); err != nil {
|
||||
return 0, err
|
||||
return 0, maybeReplaceError(err)
|
||||
}
|
||||
return w.bufferedStr.Write(p)
|
||||
n, err := w.bufferedStr.Write(p)
|
||||
return n, maybeReplaceError(err)
|
||||
}
|
||||
|
||||
func (w *responseWriter) FlushError() error {
|
||||
|
@ -177,7 +178,7 @@ func (w *responseWriter) FlushError() error {
|
|||
}
|
||||
if !w.written {
|
||||
if err := w.writeHeader(); err != nil {
|
||||
return err
|
||||
return maybeReplaceError(err)
|
||||
}
|
||||
w.written = true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue