errors

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(e1 error, e2 ...error) error

Append combines the provided errors into a single error. Any nil-value error will be effectively dropped (since it's not an error), and if all errors are nil, then nil is returned

func Is

func Is(err, target error) bool

Is wraps golang's errors.Is function to provide easier use when using this package and golang's underlying errors package

func MaybeWrap

func MaybeWrap(err error, msg string) error

MaybeWrap conditionally wraps an error. if the provided error is nil, then nil will be returned otherwise, the error will be wrapped as per the errors.Wrap function

func MultiErrorPrintFormat

func MultiErrorPrintFormat(errs []error) string

MultiErrorPrintFormat provides the common error printing function for hashicorp/go-multierror Format is err1 : err2 : ... : errN (roughly equivalement to strings.Join(errs, " : ") )

func New

func New(msg string) error

New wraps golang's error.New function to provide easier use when using this package and trying to create a new error

func Wrap

func Wrap(err error, msg string) error

Wrap constructs a new error from the provided error with the msg text applied the wrapped message is in the form of "msg : err". if the provided error is nil, then errors.New is used instead

Types

This section is empty.

Jump to

Keyboard shortcuts

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