errorx

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(fns ...func() error) error

Chain runs funs one by one until an error occurred

func In

func In(err error, errs ...error) bool

In checks if the given err is one of errs

func New

func New(text string) error

New creates a new error

func Wrap

func Wrap(err error, message string) error

Wrap returns an error that wraps err with given message

func Wrapf

func Wrapf(err error, format string, args ...any) error

Wrapf returns an error that wraps err with given format and args

Types

type AtomicError

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

AtomicError defines an atomic error

func (*AtomicError) Load

func (ae *AtomicError) Load() error

Load returns the error

func (*AtomicError) Set

func (ae *AtomicError) Set(err error)

Set sets the error

type BatchError

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

BatchError is an error that can hold multiple errors

func (*BatchError) Add

func (be *BatchError) Add(errs ...error)

Add adds one or more non-nil errors to the BatchError instance

func (*BatchError) Err

func (be *BatchError) Err() error

Err returns an error that represents all accumulated errors It returns nil if there are no errors

func (*BatchError) NotNil

func (be *BatchError) NotNil() bool

NotNil checks if there is at least one error inside the BatchError

Jump to

Keyboard shortcuts

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