Documentation ¶
Overview ¶
multierror is a simple Go package for combining multiple errors together.
Index ¶
- func Cause(err error) error
- func Error(args ...interface{}) error
- func Errorf(format string, args ...interface{}) error
- func New(message string) error
- func NewWithCode(err error, code ErrorCode, msg string) error
- func NewWithPayload(err error, code ErrorCode, payload interface{}, msg string) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type ErrorCode
- type ErrorPayload
- type Errors
- type Frame
- type MultiError
- type StackTrace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:
type Causer interface { Cause() error }
If the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a value that satisfies error.
func NewWithCode ¶
NewWithCode create a error with error code and message
func NewWithPayload ¶
NewWithPayload create error with error code and payload and message
Types ¶
type ErrorCode ¶
type ErrorCode int
ErrorCode is enum object of errors
func CodeWithPayload ¶
CodeWithPayload return error code and payload
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s path of source file relative to the compile time GOPATH %+v equivalent to %+s:%d
type MultiError ¶
type MultiError struct {
Errors Errors
}
The MultiError type implements the error interface, and contains the Errors used to construct it.
func (*MultiError) Error ¶
func (m *MultiError) Error() string
Returns a concatenated string of the contained errors
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).