errorx

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 3 Imported by: 2

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 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 ...interface{}) 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
}

A BatchError is an error that can hold multiple errors.

func (*BatchError) Add

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

Add adds errs to be, nil errors are ignored.

func (*BatchError) Err

func (be *BatchError) Err() error

Err returns an error that represents all errors.

func (*BatchError) NotNil

func (be *BatchError) NotNil() bool

NotNil checks if any error inside.

Jump to

Keyboard shortcuts

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