neterrors

package
v0.4.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArgument  = New(protocol.StatusErrInvalidArgument, "invalid argument")
	ErrUnknownOperation = New(protocol.StatusErrUnknownOperation, "unknown operation")
	ErrInternalFailure  = New(protocol.StatusErrInternalFailure, "internal failure")
	ErrNotImplemented   = New(protocol.StatusErrNotImplemented, "not implemented")
	ErrOperationTimeout = New(protocol.StatusErrOperationTimeout, "operation timeout")
)

Functions

func ErrorResponse

func ErrorResponse(w protocol.EncodeDecoder, msg interface{})

func GetByCode

func GetByCode(code protocol.StatusCode) error

func Unwrap

func Unwrap(err error) error

func Wrap

func Wrap(err error, message interface{}) error

Wrap extends this error with an additional information.

Types

type NetError

type NetError struct {
	// contains filtered or unexported fields
}

NetError defines a custom error type.

func New

func New(code protocol.StatusCode, message string) *NetError

func (*NetError) Bytes

func (e *NetError) Bytes() []byte

func (*NetError) Error

func (e *NetError) Error() string

func (*NetError) StatusCode

func (e *NetError) StatusCode() protocol.StatusCode

Jump to

Keyboard shortcuts

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