xerrors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnwrapAll

func UnwrapAll(err error) []error

Types

type Option

type Option interface {
	Key() string
	Value() any
}

func NewCallableOption

func NewCallableOption(key string, getValue func() any) Option

func NewOption

func NewOption(key string, value any) Option

type XError

type XError interface {
	error
	ErrorCode() string
	ErrorOptions() []Option
	WithMessage(message string, code string, options ...Option) XError
	WithError(err error, code string, options ...Option) XError
	WithOptions(code string, options ...Option) XError
}

func New

func New(message string, code string, options ...Option) XError

func ToXError added in v0.0.3

func ToXError(err error, code string, options ...Option) XError

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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