WrapWithDepthf wraps an error. It also annotates the provided pg code as new candidate code, to be used if the underlying error does not have one already.
(
depth int, err error, code pgcode.Code, format string, args ...interface{},
)
| 20 | // pg code as new candidate code, to be used if the underlying |
| 21 | // error does not have one already. |
| 22 | func WrapWithDepthf( |
| 23 | depth int, err error, code pgcode.Code, format string, args ...interface{}, |
| 24 | ) error { |
| 25 | err = errors.WrapWithDepthf(1+depth, err, format, args...) |
| 26 | err = WithCandidateCode(err, code) |
| 27 | return err |
| 28 | } |
| 29 | |
| 30 | // Wrap wraps an error and adds a pg error code. Only the code |
| 31 | // is added if the message is empty. |
no test coverage detected
searching dependent graphs…