Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Export a number of functions or variables from pkg/errors. We want people to be able to use them, if only via the entrypoints we've vetted in this file.
Functions ¶
func New ¶
New acts as pkg/errors.New does, producing a stack traced error, but supports interpolating of message parameters. Use this when you want the stack trace to start at the place you create the error.
func RecoverPanic ¶
func RecoverPanic(r interface{}, errPtr *error)
RecoverPanic turns a panic into an error, adjusting the stacktrace so it originates at the line that caused it.
Example:
func Do() (err error) { defer func() { errors.RecoverPanic(recover(), &err) }() }
func Sentinel ¶
Sentinel is used to create compile-time errors that are intended to be value only, with no associated stack trace.
func Wrap ¶
Wrap creates a new error from a cause, decorating the original error message with a prefix.
It differs from the pkg/errors Wrap/Wrapf by idempotently creating a stack trace, meaning we won't create another stack trace when there is already a stack trace present that matches our current program position.
Types ¶
type StackTrace ¶
type StackTrace = errors.StackTrace
StackTrace should be aliases rather than newtype'd, so it can work with any of the functions we export from pkg/errors.
type StackTracer ¶
type StackTracer interface {
StackTrace() errors.StackTrace
}