Wrapf returns an error annotating err with a stack trace at the point Wrapf is called, and the format specifier. If err is nil, Wrapf returns nil.
(err error, format string, args ...interface{})
| 199 | // at the point Wrapf is called, and the format specifier. |
| 200 | // If err is nil, Wrapf returns nil. |
| 201 | func Wrapf(err error, format string, args ...interface{}) error { |
| 202 | if err == nil { |
| 203 | return nil |
| 204 | } |
| 205 | err = &withMessage{ |
| 206 | cause: err, |
| 207 | msg: fmt.Sprintf(format, args...), |
| 208 | } |
| 209 | return &withStack{ |
| 210 | err, |
| 211 | callers(), |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | // WithMessage annotates err with a new message. |
| 216 | // If err is nil, WithMessage returns nil. |
searching dependent graphs…