MCPcopy Create free account
hub / github.com/DoNewsCode/core / Wrapf

Function Wrapf

unierr/error.go:65–70  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

63// in the wrapped error becomes irrelevant as it is overwritten by the new
64// message.
65func 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.

Callers 1

errFunction · 0.85

Calls 1

WrapFunction · 0.85

Tested by

no test coverage detected