errz

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanceled           = E(canceled)
	ErrUnknown            = E(unknown)
	ErrInvalidArgument    = E(invalidArgument)
	ErrDeadlineExceeded   = E(deadlineExceeded)
	ErrNotFound           = E(notFound)
	ErrAlreadyExists      = E(alreadyExists)
	ErrPermissionDenied   = E(permissionDenied)
	ErrResourceExhausted  = E(resourceExhausted)
	ErrFailedPrecondition = E(failedPrecondition)
	ErrAborted            = E(aborted)
	ErrOutOfRange         = E(outOfRange)
	ErrUnimplemented      = E(unimplemented)
	ErrInternal           = E(internal)
	ErrUnavailable        = E(unavailable)
	ErrDataLoss           = E(dataLoss)
	ErrUnauthenticated    = E(unauthenticated)
)
View Source
var DefaultFactory = Factory().StackTrace(true)

Functions

func As

func As(err error, target any) bool

func CodeOf

func CodeOf(err error) code

CodeOf returns the error's status code if it is or wraps an *Error and [unknown] otherwise.

func Factory

func Factory() *factory

func Is

func Is(err error, targets ...error) bool

func IsNot

func IsNot(err error, targets ...error) bool

func Join

func Join(errs ...error) error

func NotAs

func NotAs(err error, target any) bool

func Unwrap

func Unwrap(err error) error

Types

type Error

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

func E

func E(in ...any) *Error

func F

func F(format string, args ...any) *Error

func (*Error) As added in v0.1.1

func (e *Error) As(err error) bool

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is added in v0.1.1

func (e *Error) Is(err error) bool

func (*Error) IsEmpty

func (e *Error) IsEmpty() bool

func (*Error) String

func (e *Error) String() string

func (*Error) Unwrap

func (e *Error) Unwrap() []error

func (*Error) With

func (e *Error) With(key string, value any) *Error

func (*Error) WithLocation

func (e *Error) WithLocation() *Error

func (*Error) WithTime

func (e *Error) WithTime() *Error

func (*Error) WithTrace

func (e *Error) WithTrace() *Error

func (*Error) Wrap

func (e *Error) Wrap(err error) *Error

Jump to

Keyboard shortcuts

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