Documentation ¶
Index ¶
- Variables
- type ErrorCode
- type QuicError
- func ApplicationError(errorCode ErrorCode, errorMessage string) *QuicError
- func CryptoError(tlsAlert uint8, errorMessage string) *QuicError
- func Error(errorCode ErrorCode, errorMessage string) *QuicError
- func ErrorWithFrameType(errorCode ErrorCode, frameType uint64, errorMessage string) *QuicError
- func TimeoutError(errorMessage string) *QuicError
- func ToQuicError(err error) *QuicError
Constants ¶
This section is empty.
Variables ¶
var UserCanceledError = &QuicError{ErrorCode: 0x15a}
UserCanceledError is used if the application closes the connection before the handshake completes.
Functions ¶
This section is empty.
Types ¶
type ErrorCode ¶
type ErrorCode uint64
ErrorCode can be used as a normal error without reason.
const ( NoError ErrorCode = 0x0 InternalError ErrorCode = 0x1 ServerBusy ErrorCode = 0x2 FlowControlError ErrorCode = 0x3 StreamLimitError ErrorCode = 0x4 StreamStateError ErrorCode = 0x5 FinalSizeError ErrorCode = 0x6 FrameEncodingError ErrorCode = 0x7 TransportParameterError ErrorCode = 0x8 ConnectionIDLimitError ErrorCode = 0x9 ProtocolViolation ErrorCode = 0xa InvalidToken ErrorCode = 0xb CryptoBufferExceeded ErrorCode = 0xd )
The error codes defined by QUIC
type QuicError ¶
type QuicError struct { ErrorCode ErrorCode FrameType uint64 // only valid if this not an application error ErrorMessage string // contains filtered or unexported fields }
A QuicError consists of an error code plus a error reason
func ApplicationError ¶ added in v0.12.0
ApplicationError creates a new QuicError instance for an application error
func CryptoError ¶
CryptoError create a new QuicError instance for a crypto error
func ErrorWithFrameType ¶ added in v0.13.1
ErrorWithFrameType creates a new QuicError instance for a specific frame type
func TimeoutError ¶
TimeoutError creates a new QuicError instance for a timeout error
func ToQuicError ¶
ToQuicError converts an arbitrary error to a QuicError. It leaves QuicErrors unchanged, and properly handles `ErrorCode`s.
func (*QuicError) IsApplicationError ¶ added in v0.13.1
IsApplicationError says if this error is an application error
func (*QuicError) IsCryptoError ¶
IsCryptoError says if this error is a crypto error