Documentation
¶
Index ¶
- func As(err error, target interface{}) bool
- func Base(format string, a ...interface{}) error
- func Err(e interface{}, fmtParams ...interface{}) error
- func FullTrace(err error) string
- func HasTrace(err error) bool
- func Is(err, target error) bool
- func Prefix(prefix string, err interface{}) error
- func Recover(e *error)
- func Trace(err error) string
- func Unwrap(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Err ¶
func Err(e interface{}, fmtParams ...interface{}) error
Err returns an error with stack trace
func Recover ¶ added in v0.14.3
func Recover(e *error)
Recover is similar to the bulitin `recover()`, except it includes a stack trace as well Since `recover()` only works when called inside a deferred function (but not any function called by it), you should call Recover() as follows
err := func() (e error) { defer errors.Recover(&e) funcThatMayPanic() return e }()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.