multierror

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const Indent = "  "
View Source
const Prefix = "- "

Variables

This section is empty.

Functions

func Unwrap

func Unwrap(errs ...error) []error

Unwrap flattens zero or more errors and/or MultiErrors into a list of errors. MultiErrors are recursively unwrapped to reduce depth.

func Wrap

func Wrap(errs ...error) error

Wrap merges zero or more errors and/or MultiErrors into one error. MultiErrors are recursively unwrapped to reduce depth. If only one error is received, that error is returned without a wrapper.

Types

type Interface

type Interface interface {
	Errors() []error
}

type MultiError

type MultiError struct {
	Causes []error
}

MultiError wraps multiple errors and formats them for multi-line output.

func New

func New(causes ...error) *MultiError

New returns a new MultiError wrapping the specified error list.

func (*MultiError) Error

func (mve *MultiError) Error() string

func (*MultiError) Errors

func (mve *MultiError) Errors() []error

Jump to

Keyboard shortcuts

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