Documentation ¶
Overview ¶
Package errors provides a way to return detailed information for a request error. The error is normally JSON encoded.
Index ¶
- Constants
- Variables
- func As(err error, target interface{}) bool
- func Cause(err error) error
- func ErrorFormatJSON(i []error) string
- func Errorf(format string, args ...interface{}) error
- func Is(err, target error) bool
- func Join(errs ...error) error
- func New(message string) error
- func Stack(v string) error
- func Stackf(format string, args ...interface{}) error
- func Unwrap(err error) error
- func WithStack(err error) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type ErrorFormatFunc
- type MultiError
- type String
- type ThreadSafeMultiError
Constants ¶
View Source
const (
UnsupportedError = String("unsupported error")
)
Variables ¶
View Source
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 ¶
func ErrorFormatJSON ¶ added in v0.0.3
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 String ¶ added in v0.0.3
type String 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 any) error
Has checks if the MultiError collection has the given merr or not
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
Click to show internal directories.
Click to hide internal directories.