Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( As = errors.As Unwrap = errors.Unwrap Verbosity = 2 BasePath = "" BaseCachePath = "" BaseModule = "" BaseGoSrcPath = "" BaseGoSrcToken = "" MaxStackDepth = 32 MaxPrintStackFrames = 5 MaxPrintCauses = 5 )
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 Is ¶
Detects whether the error is equal to a given error. Errors are considered equal by this function if they are matched by errors.Is or if their contained errors are matched through errors.Is
func RecoverPanic ¶
func RecoverPanic(r interface{}, errPtr *error)
RecoverPanic turns a panic into an error.
Example:
func Do() (err error) { defer func() { errors.RecoverPanic(recover(), &err) }() }
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) StackTrace ¶
func (e *Error) StackTrace() StackTrace
func (*Error) StackTraceString ¶ added in v0.0.2
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
func (Frame) File ¶ added in v0.0.2
File returns the full path to the File that contains the function for this Frame's pc.
func (Frame) Line ¶ added in v0.0.2
Line returns the Line number of source code of the function for this Frame's pc.
func (Frame) Pc ¶ added in v0.0.2
Pc returns the program counter for this frame; multiple frames may have the same PC value.
func (Frame) RelFuncName ¶ added in v0.0.2
function name relative to main package
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).