Documentation ¶
Overview ¶
Package errors provides richer error handling functionality
Errors created or wrapped include a stack trace, optional additional context messages, and optional additional relevant data.
Index ¶
- func Cause(e error) error
- func New(msg string) error
- func Newf(format string, args ...interface{}) error
- func Newv(msg string, values map[string]interface{}) error
- func ResetStack(err error) error
- func Wrap(err error, msg ...string) error
- func Wrapf(err error, format string, args ...interface{}) error
- func Wrapv(err error, values map[string]interface{}, msg ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Newv ¶
Newv returns a new error with the callstack that formats as the given text and associates the supplied data with the error.
func ResetStack ¶
ResetStack generates a new stack trace for the error at the current location if one was present. This is useful when the original stack trace is too generic to be useful, such as a generic goroutine handling communication processing and relaying errors back to the original caller. Every error would have the generic goroutine stack trace when wrapped. Allowing the stack to be recaptured at the point where the error arrives back at the original caller provides much more useful information.
func Wrap ¶
Wrap wraps an error, creating a callstack if necessary and prefixing the underlying error message with the optional given text.
Types ¶
This section is empty.