Wrap wraps an error and adds a pg error code. Only the code is added if the message is empty.
(err error, code, msg string)
| 30 | // Wrap wraps an error and adds a pg error code. Only the code |
| 31 | // is added if the message is empty. |
| 32 | func Wrap(err error, code, msg string) error { |
| 33 | if msg == "" { |
| 34 | return WithCandidateCode(err, code) |
| 35 | } |
| 36 | return WrapWithDepthf(1, err, code, "%s", msg) |
| 37 | } |
no test coverage detected
searching dependent graphs…