Documentation
¶
Overview ¶
Package errstack provides utilities to manage error stack traces.
Example ¶
err := errors.New("error") err = Wrap(err) fmt.Println(err) sfs := slices.Collect(Frames(err)) fmt.Println(len(sfs))
Output: error 2
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSkip ¶
EnsureSkip adds a stack to an error if it does not already have one, skipping the given number of frames.
func Frames ¶
Frames returns the list of runtime.Frame associated to an error.
func Wrap ¶
Wrap adds a stack to an error.
The verbose message contains the stack.
See runtime.Frames.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.