WrapSkip wraps error with text. It returns nil if given err is nil. The parameter `skip` specifies the stack callers skipped amount. Note that it does not lose the error code of wrapped error, as it inherits the error code from it.
(skip int, err error, text string)
| 84 | // The parameter `skip` specifies the stack callers skipped amount. |
| 85 | // Note that it does not lose the error code of wrapped error, as it inherits the error code from it. |
| 86 | func WrapSkip(skip int, err error, text string) error { |
| 87 | if err == nil { |
| 88 | return nil |
| 89 | } |
| 90 | return &Error{ |
| 91 | error: err, |
| 92 | stack: callers(skip), |
| 93 | text: text, |
| 94 | code: Code(err), |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | // WrapSkipf wraps error with text that is formatted with given format and args. It returns nil if given err is nil. |
| 99 | // The parameter `skip` specifies the stack callers skipped amount. |
searching dependent graphs…