errors

package
v2.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 5 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNil                     = New("nil")
	ErrInvalidGID              = New("invalid gate id")
	ErrInvalidNID              = New("invalid node id")
	ErrInvalidMessage          = New("invalid message")
	ErrInvalidReader           = New("invalid reader")
	ErrNotFoundSession         = New("not found session")
	ErrInvalidSessionKind      = New("invalid session kind")
	ErrReceiveTargetEmpty      = New("the receive target is empty")
	ErrInvalidArgument         = New("invalid argument")
	ErrNotFoundRoute           = New("not found route")
	ErrNotFoundEvent           = New("not found event")
	ErrNotFoundEndpoint        = New("not found endpoint")
	ErrNotFoundUserLocation    = New("not found user's location")
	ErrClientShut              = New("client is shut")
	ErrConnectionOpened        = New("connection is opened")
	ErrConnectionHanged        = New("connection is hanged")
	ErrConnectionClosed        = New("connection is closed")
	ErrConnectionAlived        = New("connection is alived")
	ErrConnectionNotAlived     = New("connection is not alived")
	ErrConnectionNotOpened     = New("connection is not opened")
	ErrConnectionNotHanged     = New("connection is not hanged")
	ErrTooManyConnection       = New("too many connection")
	ErrSeqOverflow             = New("seq overflow")
	ErrRouteOverflow           = New("route overflow")
	ErrMessageTooLarge         = New("message too large")
	ErrInvalidDecoder          = New("invalid decoder")
	ErrInvalidScanner          = New("invalid scanner")
	ErrNoOperationPermission   = New("no operation permission")
	ErrInvalidConfigContent    = New("invalid config content")
	ErrNotFoundConfigSource    = New("not found config source")
	ErrConfigStoreFailed       = New("config store failed")
	ErrInvalidFormat           = New("invalid format")
	ErrIllegalRequest          = New("illegal request")
	ErrIllegalOperation        = New("illegal operation")
	ErrInvalidPointer          = New("invalid pointer")
	ErrNotFoundLocator         = New("not found locator")
	ErrUnexpectedEOF           = New("unexpected EOF")
	ErrMissingTransporter      = New("missing transporter")
	ErrMissingDiscovery        = New("missing discovery")
	ErrNotFoundServiceAddress  = New("not found service address")
	ErrUnknownError            = New("unknown error")
	ErrClientClosed            = New("client is closed")
	ErrClientStarted           = New("client is started")
	ErrServerClosed            = New("server is closed")
	ErrServerStarted           = New("server is started")
	ErrActorExists             = New("actor exists")
	ErrActorCreateFailed       = New("actor create failed")
	ErrMissingDispatchStrategy = New("missing dispatch strategy")
	ErrUnregisterRoute         = New("unregistered route")
	ErrNotBindActor            = New("not bind actor")
	ErrNotFoundActor           = New("not found actor")
	ErrSyncerClosed            = New("syncer is closed")
	ErrDeadlineExceeded        = New("deadline exceeded")
	ErrMissingResolver         = New("missing resolver")
	ErrServiceRegisterFailed   = New("service register failed")
	ErrServiceDeregisterFailed = New("service deregister failed")
	ErrRegistryClosed          = New("registry is closed")
	ErrInvalidPublicKey        = New("invalid public key")
	ErrInvalidPrivateKey       = New("invalid private key")
	ErrInvalidSignature        = New("invalid signature")
	ErrNotFoundIPAddress       = New("not found ip address")
	ErrInvalidServiceDesc      = New("invalid service desc")
	ErrInvalidCertFile         = New("invalid cert file")
	ErrMissingCacheInstance    = New("missing cache instance")
	ErrMissingEventbusInstance = New("missing eventbus instance")
	ErrActorNotStarted         = New("actor not started")
	ErrWatcherStopped          = New("watcher stopped")
	ErrWriteTimeout            = New("write timeout")
	ErrQueueHanged             = New("queue is hanged")
	ErrQueueClosed             = New("queue is closed")
	ErrGateShutdown            = New("gate is shutdown")
	ErrNodeShutdown            = New("node is shutdown")
	ErrMeshShutdown            = New("mesh is shutdown")
	ErrCacheClosed             = New("cache is closed")
	ErrIllegalInvoke           = New("illegal invoke")
)

Functions

func As

func As(err error, target any) bool

As Wrapping for errors.As standard library

func Cause

func Cause(err error) error

Cause returns the root cause of err.

func Code

func Code(err error) *codes.Code

Code returns the error code carried by err, or nil when it carries none.

func Is

func Is(err, target error) bool

Is Wrapping for errors.Is standard library

func New

func New(text string) error

New Wrapping for errors.New standard library

func Next

func Next(err error) error

Next returns the next error in the chain.

func Replace

func Replace(err error, text string, condition ...*codes.Code) error

Replace replaces the text of err when it supports replacement and its code matches condition.

func Stack

func Stack(err error) *stack.Stack

Stack returns the stack captured by err.

func Unwrap

func Unwrap(err error) error

Unwrap Wrapping for errors.Unwrap standard library

Types

type Error

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

func NewError

func NewError(args ...any) *Error

NewError creates a new error.

The following arguments are recognized: a string sets the text, a *codes.Code sets the code, and an error sets the underlying error.

func NewErrorWithStack

func NewErrorWithStack(args ...any) *Error

NewErrorWithStack creates a new error with a captured stack.

The following arguments are recognized: a string sets the text, a *codes.Code sets the code, and an error sets the underlying error.

func (*Error) Cause

func (e *Error) Cause() error

Cause returns the root cause error.

func (*Error) Code

func (e *Error) Code() *codes.Code

Code returns the error code.

func (*Error) Error

func (e *Error) Error() (text string)

func (*Error) Format

func (e *Error) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

The %s verb prints the error at the current level, %v prints all error information, and %+v prints all error information together with the stack.

func (*Error) Next

func (e *Error) Next() error

Next returns the next error.

func (*Error) Replace

func (e *Error) Replace(text string, condition ...*codes.Code) error

Replace replaces the text when condition is empty or matches the error code.

func (*Error) Stack

func (e *Error) Stack() *stack.Stack

Stack returns the stack.

func (*Error) String

func (e *Error) String() string

String returns the formatted error information.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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