Wrapf annotates an error with a codes.Code, and provides a new error message. The wrapped error hence is mainly kept for tracing and debugging. The message in the wrapped error becomes irrelevant as it is overwritten by the new message.
(err error, code codes.Code, format string, args ...interface{})
| 63 | // in the wrapped error becomes irrelevant as it is overwritten by the new |
| 64 | // message. |
| 65 | func Wrapf(err error, code codes.Code, format string, args ...interface{}) *Error { |
| 66 | se := Wrap(err, code) |
| 67 | se.msg = format |
| 68 | se.args = args |
| 69 | return se |
| 70 | } |
| 71 | |
| 72 | // Error is the unified error type for HTTP/gRPC transports. |
| 73 | // In grpc transports, Error can not only be constructed from a grpc status but also producing a native grpc status. |