errors

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target any) bool

As just a facade for errors.As

func AsRemoteError added in v0.5.10

func AsRemoteError(err error) error

func DecodeMsgPack added in v0.4.0

func DecodeMsgPack(using codec.MsgPackDecoder) (error, error)

func EncodeMsgPack added in v0.4.0

func EncodeMsgPack(err error, using codec.MsgPackEncoder) error

func Is

func Is(err, target error) bool

Is just a facade for errors.Is

func IsType

func IsType(err error, t Type, otherT ...Type) bool

func Unwrap

func Unwrap(err error) error

Unwrap just a facade for errors.Unwrap

Types

type Error

type Error struct {
	Message    string
	Cause      error
	Type       Type
	UserFacing bool
}

func IsError

func IsError(err error) (eErr *Error, ok bool)

func Newf

func Newf(t Type, msg string, args ...any) *Error

func (*Error) DecodeMsgPack added in v0.4.0

func (this *Error) DecodeMsgPack(dec codec.MsgPackDecoder) (err error)

func (*Error) DecodeMsgpack added in v0.4.0

func (this *Error) DecodeMsgpack(dec *msgpack.Decoder) (err error)

func (Error) EncodeMsgPack added in v0.4.0

func (this Error) EncodeMsgPack(enc codec.MsgPackEncoder) error

func (Error) EncodeMsgpack added in v0.4.0

func (this Error) EncodeMsgpack(enc *msgpack.Encoder) error

func (*Error) Error

func (this *Error) Error() string

func (*Error) Extend added in v0.4.0

func (this *Error) Extend(args ...any) *Error

func (*Error) Extendf added in v0.4.0

func (this *Error) Extendf(msg string, args ...any) *Error

func (*Error) Unwrap

func (this *Error) Unwrap() error

type RemoteError added in v0.5.10

type RemoteError struct {
	Err error
}

func (RemoteError) Error added in v0.5.10

func (this RemoteError) Error() string

func (RemoteError) String added in v0.5.10

func (this RemoteError) String() string

func (RemoteError) Unwrap added in v0.5.10

func (this RemoteError) Unwrap() error

type Type

type Type uint8
const (
	Unknown Type = iota
	System
	Config
	Network
	User
	Permission
	Expired
)

func (*Type) DecodeMsgPack added in v0.4.0

func (this *Type) DecodeMsgPack(dec codec.MsgPackDecoder) error

func (*Type) DecodeMsgpack added in v0.4.0

func (this *Type) DecodeMsgpack(dec *msgpack.Decoder) (err error)

func (Type) EncodeMsgPack added in v0.4.0

func (this Type) EncodeMsgPack(enc codec.MsgPackEncoder) error

func (Type) EncodeMsgpack added in v0.4.0

func (this Type) EncodeMsgpack(enc *msgpack.Encoder) error

func (Type) IsEqualTo

func (t Type) IsEqualTo(other any) bool

func (Type) IsErr

func (t Type) IsErr(err error) bool

func (Type) IsZero

func (t Type) IsZero() bool

func (Type) MarshalText

func (t Type) MarshalText() ([]byte, error)

func (Type) Newf

func (t Type) Newf(msg string, args ...any) *Error

func (*Type) Set

func (t *Type) Set(plain string) error

func (Type) String

func (t Type) String() string

func (*Type) UnmarshalText

func (t *Type) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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