multierror

package
v1.0.0-r Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Errors []error
}

Error is an error type to track multiple errors. This can be used to accumulate errors and return them as a single "error" type.

func New

func New(errs ...error) *Error

New will return a new multierror.

func (*Error) Append

func (e *Error) Append(errs ...error)

Append will append errors to the multierror.

func (*Error) Error

func (e *Error) Error() string

func (*Error) ErrorOrNil

func (e *Error) ErrorOrNil() error

ErrorOrNil returns an error interface if the multierror represents a list of errors or nil if the list is empty.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns an error from Error (or nil if there are no errors). The error returned supports Unwrap, so that the entire chain of errors can be unwrapped. The order will match the order of Errors at the time of calling.

This will perform a shallow copy of the errors slice. Any errors appended to this error after calling Unwrap will not be available until a new Unwrap is called on the multierror.Error.

func (*Error) WrapErrorOrNil

func (e *Error) WrapErrorOrNil(toWrap error) error

WrapErrorOrNil will wrap the given error if the multierror contains errors.

Jump to

Keyboard shortcuts

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