multierror

package
v0.36.0-flux.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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