Source File
error.go
Belonging Package
github.com/quic-go/quic-go/http3
package http3import ()// Error is returned from the round tripper (for HTTP clients)// and inside the HTTP handler (for HTTP servers) if an HTTP/3 error occurs.// See section 8 of RFC 9114.type Error struct {Remote boolErrorCode ErrCodeErrorMessage string}var _ error = &Error{}func ( *Error) () string {:= .ErrorCode.string()if == "" {= fmt.Sprintf("H3 error (%#x)", uint64(.ErrorCode))}// Usually errors are remote. Only make it explicit for local errors.if !.Remote {+= " (local)"}if .ErrorMessage != "" {+= ": " + .ErrorMessage}return}func ( *Error) ( error) bool {, := .(*Error)return && .ErrorCode == .ErrorCode && .Remote == .Remote}func maybeReplaceError( error) error {if == nil {return nil}var (Error*quic.StreamError*quic.ApplicationError)switch {default:returncase errors.As(, &):.Remote = .Remote.ErrorCode = ErrCode(.ErrorCode)case errors.As(, &):.Remote = .Remote.ErrorCode = ErrCode(.ErrorCode).ErrorMessage = .ErrorMessage}return &}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |