Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame.
func StackLevel ¶
StackLevel returns a stack from for parsing into a trace line this is primarily used by other libraries who use this package internally as the level needs to be adjusted.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time
GOPATH separated by \n\t (<funcname>\n\t<path>)
%+v equivalent to %+s:%d
type Tag ¶
type Tag struct {
Key string
Value interface{}
}
Tag contains a single key value conbination to be attached to your error
type Wrapped ¶
type Wrapped struct {
// Errors contains the chain of errors and is only set on the top level error
// so if len() > 0 it's the top level error and no other error information is
// on this object, but within the array of errors.
Errors []*Wrapped
// Err is the wrapped error, either the original or already wrapped
Err error
// Prefix contains the error prefix text
Prefix string
// Type stores one or more categorized types of error set by the caller using WithTypes and is optional
Types []string
// Tags contains an array of tags associated with this error, if any
Tags []Tag
// Source contains the name, file and lines obtained from the stack trace
Source string
}
Wrapped contains a single error entry, unless it's the top level error, in which case it only contains an array of errors
func Wrap ¶
Wrap encapsulates the error, stores a contextual prefix and automatically obtains a stack trace.