xerrors

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOptionValue

func GetOptionValue[T any](optionKey string, err error) (T, bool)

func UnwrapAll

func UnwrapAll(err error) []error

Types

type Option

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

func GetAllOptions

func GetAllOptions(err error) []Option

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
	Options() []Option
	WithMessage(message string, options ...Option) XError
	WithError(err error, options ...Option) XError
	WithOptions(options ...Option) XError
}

func ConvertToXError

func ConvertToXError(err error, options ...Option) XError

func New

func New(message 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