Documentation ¶
Overview ¶
Package stackerr provides a way to augment errors with one or more stack traces to allow for easier debugging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Underlying ¶
Underlying returns all the underlying errors by iteratively checking if the error has an Underlying error. If e is nil, the returned slice will be nil.
func Wrap ¶
Wrap provides a convenience function that calls WrapSkip with skip=0. That is, the Stack starts with the caller of Wrap.
func WrapSkip ¶
WrapSkip the error and add the current Stack. The argument skip is the number of stack frames to ascend, with 0 identifying the caller of Wrap. If the error to be wrapped has a MultiStack, the current stack will be added to it. If the error to be wrapped is nil, a nil error is returned.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error provides the wrapper that adds multiple Stacks to an error. Each Stack represents a location in code thru which this error was wrapped.
func (*Error) MultiStack ¶
MultiStack identifies the locations this error was wrapped at.
func (*Error) Underlying ¶
Underlying returns the error that is being wrapped.