qerr

package
v0.22.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdleTimeout      = newTimeoutError("No recent network activity")
	ErrHandshakeTimeout = newTimeoutError("Handshake did not complete in time")
)

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
	ConnectionRefused       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
	ApplicationError        ErrorCode = 0xc
	CryptoBufferExceeded    ErrorCode = 0xd
	KeyUpdateError          ErrorCode = 0xe
	AEADLimitReached        ErrorCode = 0xf
	NoViablePathError       ErrorCode = 0x10
)

The error codes defined by QUIC

func (ErrorCode) Error

func (e ErrorCode) Error() string

func (ErrorCode) Message

func (e ErrorCode) Message() string

Message is a description of the error. It only returns a non-empty string for crypto errors.

func (ErrorCode) String

func (e ErrorCode) String() string

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 NewApplicationError

func NewApplicationError(errorCode ErrorCode, errorMessage string) *QuicError

NewApplicationError creates a new QuicError instance for an application error

func NewCryptoError

func NewCryptoError(tlsAlert uint8, errorMessage string) *QuicError

NewCryptoError create a new QuicError instance for a crypto error

func NewError

func NewError(errorCode ErrorCode, errorMessage string) *QuicError

NewError creates a new QuicError instance

func NewErrorWithFrameType

func NewErrorWithFrameType(errorCode ErrorCode, frameType uint64, errorMessage string) *QuicError

NewErrorWithFrameType creates a new QuicError instance for a specific frame type

func ToQuicError

func ToQuicError(err error) *QuicError

ToQuicError converts an arbitrary error to a QuicError. It leaves QuicErrors unchanged, and properly handles `ErrorCode`s.

func (*QuicError) Error

func (e *QuicError) Error() string

func (*QuicError) IsApplicationError

func (e *QuicError) IsApplicationError() bool

IsApplicationError says if this error is an application error

func (*QuicError) IsCryptoError

func (e *QuicError) IsCryptoError() bool

IsCryptoError says if this error is a crypto error

func (*QuicError) Temporary

func (e *QuicError) Temporary() bool

Temporary says if the error is temporary.

func (*QuicError) Timeout

func (e *QuicError) Timeout() bool

Timeout says if this error is a timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL