Documentation
¶
Overview ¶
Package errors provides a way to return detailed information for a request error. The error is normally JSON encoded.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Stack adds stack trace to error, with message Stack = errors.New // Stackf adds stack trace to error, with format specifier Stackf = errors.Errorf // Wrap returns an error annotating err with a stack trace Wrap = errors.WithMessage // Wrapf returns an error annotating err with a stack trace Wrapf = errors.WithMessagef )
Define alias from pkg/errors
var ( // Errorf formats according to a format specifier and returns the string as a value that satisfies error Errorf = fmt.Errorf // Is reports whether any error in errs chain matches target Is = stderr.Is // As finds the first error in errs that matches target, and if one is found, sets target to that error value and returns true. Otherwise, it returns false. As = stderr.As // Unwrap unwraps the error, and if it is a wrapper, returns the next error in the chain. Unwrap = stderr.Unwrap // New creates a new error with the given string New = stderr.New // Join joins any number of errors into a single error. Join = stderr.Join )
Define alias from stderr
var ( // Append is a helper function that will append more merr Append = merr.Append // ListFormatFunc is a helper function that will format the merr ListFormatFunc = merr.ListFormatFunc )
Functions ¶
This section is empty.
Types ¶
type ErrorFormatFunc ¶
type ErrorFormatFunc = merr.ErrorFormatFunc
ErrorFormatFunc is a helper function that will format the merr
type MultiError ¶
MultiError is an alias of `github.com/hashicorp/go-multierror`.Error
type StdError ¶
type StdError string
type ThreadSafeMultiError ¶
type ThreadSafeMultiError struct {
ErrorFormat ErrorFormatFunc
// contains filtered or unexported fields
}
ThreadSafeMultiError represents a collection of merr
func ThreadSafe ¶
func ThreadSafe(err error, fns ...ErrorFormatFunc) *ThreadSafeMultiError
ThreadSafe creates a new ThreadSafeMultiError collection
func (*ThreadSafeMultiError) Append ¶
func (e *ThreadSafeMultiError) Append(err error)
Append adds an error to the MultiError collection
func (*ThreadSafeMultiError) Error ¶
func (e *ThreadSafeMultiError) Error() string
Error returns the JSON representation of the MultiError collection
func (*ThreadSafeMultiError) Errors ¶
func (e *ThreadSafeMultiError) Errors() []error
Errors returns the merr collection
func (*ThreadSafeMultiError) Has ¶
func (e *ThreadSafeMultiError) Has(err error) error
func (*ThreadSafeMultiError) HasErrors ¶
func (e *ThreadSafeMultiError) HasErrors() bool
HasErrors checks if the MultiError collection has any merr
func (*ThreadSafeMultiError) Unsafe ¶
func (e *ThreadSafeMultiError) Unsafe() *MultiError
Unsafe returns the MultiError collection