Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Version is version of running process Version string = "dev" // Revision is the specific revision of the running process Revision string = "dirty" )
Functions ¶
func ErrStack ¶
func ErrStack() error
ErrStack returns a new error for the callers stack, this can be wrapped or joined into an existing error. NOTE: When joined with errors.Join, the stack will show up in the error string output. Use with `stack.Join` to force addition of the error stack.
func Join ¶
Join adds a stack if there is no stack included to the errors and returns a joined error with the stack hidden from the error output. The stack error shows up when Unwrapped or formatted with `%+v`.
func WithHelper ¶
WithHelper marks the context as from a helper function This will add an additional skip to the error stack trace
Types ¶
type Frame ¶
type Frame struct { Name string `json:"Name,omitempty"` File string `json:"File,omitempty"` Line int32 `json:"Line,omitempty"` }
Frame is a single frame of the trace representing a line of code
type Trace ¶
type Trace struct { Version string `json:"version,omitempty"` Revision string `json:"revision,omitempty"` Cmdline []string `json:"cmdline,omitempty"` Frames []Frame `json:"frames,omitempty"` Pid int32 `json:"pid,omitempty"` }
Trace is a stack trace along with process information about the source