WithStack annotates err with a stack trace at the point WithStack was called. If err is nil, WithStack returns nil.
(err error)
| 143 | // WithStack annotates err with a stack trace at the point WithStack was called. |
| 144 | // If err is nil, WithStack returns nil. |
| 145 | func WithStack(err error) error { |
| 146 | if err == nil { |
| 147 | return nil |
| 148 | } |
| 149 | return &withStack{ |
| 150 | err, |
| 151 | callers(), |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | type withStack struct { |
| 156 | error |
searching dependent graphs…