Wrap returns an error annotating err with a stack trace at the point Wrap is called, and the supplied message. If err is nil, Wrap returns nil.
(err error, message string)
| 182 | // at the point Wrap is called, and the supplied message. |
| 183 | // If err is nil, Wrap returns nil. |
| 184 | func Wrap(err error, message string) error { |
| 185 | if err == nil { |
| 186 | return nil |
| 187 | } |
| 188 | err = &withMessage{ |
| 189 | cause: err, |
| 190 | msg: message, |
| 191 | } |
| 192 | return &withStack{ |
| 193 | err, |
| 194 | callers(), |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // Wrapf returns an error annotating err with a stack trace |
| 199 | // at the point Wrapf is called, and the format specifier. |
searching dependent graphs…