Documentation ¶
Overview ¶
Package errors provides some convenient error implementations.
Index ¶
- Variables
- func As(err error, target interface{}) bool
- func Errorf(format string, args ...interface{}) error
- func Is(err, target error) bool
- func IsMultiError(err error) bool
- func New(text string) error
- func NewMultiError(errors ...error) error
- func Newf(format string, args ...interface{}) error
- func Unwrap(err error) error
- type MultiError
Constants ¶
This section is empty.
Variables ¶
View Source
var MultiErrorPrefix = "Multiple errors occured:\n"
MultiErrorPrefix will be prepended to the Error() output of any MultiError, that actually consists of multiple errors. You can overwrite this if you want to.
Functions ¶
func IsMultiError ¶
IsMultiError returns true if the given error was a MultiError.
func NewMultiError ¶
NewMultiError returns an error consisting of multiple errors on the same logical level. If you provide a MultiError, it will append its errors correctly.
Types ¶
type MultiError ¶
type MultiError struct {
Errors []error
}
MultiError is an implementation of error that consists of arbitrarily many errors on the same logical level.
func (*MultiError) Error ¶
func (e *MultiError) Error() string
Click to show internal directories.
Click to hide internal directories.