Documentation ¶
Index ¶
- func Dief(err error, format string, values ...interface{})
- func ErrorAs(src error, target error) (error, bool)
- func ExpandError(err error) interface{}
- func LogErrorf(err error, format string, args ...interface{})
- func LogFatalf(err error, format string, args ...interface{})
- func MustSucceed(err error, msg ...string)
- func TryToUnwrap(err error) error
- func UpdateErrorFromCall(f func() error, err *error)
- func UpdateErrorFromCloser(closer io.Closer, err *error)
- type Chainable
- type Error
- type ErrorChain
- type JsonErrorObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAs ¶
Dive into wrapped errors from src until return an error that casts to the target error or such error is not found nolint:golint
func ExpandError ¶
func ExpandError(err error) interface{}
func MustSucceed ¶
func TryToUnwrap ¶
Given an error, tries to unwrap it recursively until finds a "trivial" error which cannot be unwrapped anymore. It differs from errors.Unwrap() on returning the error itself in case it cannot be unwrapped, instead of nil
func UpdateErrorFromCall ¶
func UpdateErrorFromCloser ¶
UpdateErrorFromCloser is supposed to be used to close a io.Closer when a function exits, merging its error return into err, if any.
Types ¶
type Chainable ¶
type Chainable interface {
Chain() ErrorChain
}
type Error ¶
func (*Error) Chain ¶
func (e *Error) Chain() ErrorChain
type ErrorChain ¶
type ErrorChain []error
nolint: errname
func BuildChain ¶
func BuildChain(outer, inner error) ErrorChain
func Chain ¶
func Chain(c Chainable) ErrorChain
Return a chain of errors, from top to bottom of the "stack"
func (ErrorChain) Error ¶
func (chain ErrorChain) Error() string
func (ErrorChain) JSON ¶
func (chain ErrorChain) JSON() []JsonErrorObject
type JsonErrorObject ¶
Click to show internal directories.
Click to hide internal directories.