Stack returns the stack trace of an error. The error must contain the stack trace, or wrap an error that has a stack trace,
(err error)
| 22 | // Stack returns the stack trace of an error. The error must contain the stack |
| 23 | // trace, or wrap an error that has a stack trace, |
| 24 | func Stack(err error) []StackFrame { |
| 25 | if wErr, ok := err.(wrapperError); ok { |
| 26 | return wErr.stack |
| 27 | } |
| 28 | return nil |
| 29 | } |
| 30 | |
| 31 | // getStack is a formatting wrapper around runtime.Callers. It returns a stack |
| 32 | // trace in the form of a StackFrame slice. |