MCPcopy
hub / github.com/uber-go/zap / Error

Function Error

error.go:33–35  ·  view source on GitHub ↗

Error is shorthand for the common idiom NamedError("error", err).

(err error)

Source from the content-addressed store, hash-verified

31
32// Error is shorthand for the common idiom NamedError("error", err).
33func Error(err error) Field {
34 return NamedError("error", err)
35}
36
37// NamedError constructs a field that lazily stores err.Error() under the
38// provided key. Errors which also implement fmt.Formatter (like those produced

Callers 11

TestTestLoggerFunction · 0.92
fakeFieldsFunction · 0.92
BenchmarkErrorFieldFunction · 0.85
TestSugarWithFunction · 0.85
sweetenFieldsMethod · 0.85
TestNopLoggerFunction · 0.85
MarshalLogObjectMethod · 0.85
TestErrorConstructorsFunction · 0.85

Calls 1

NamedErrorFunction · 0.85

Tested by 9

TestTestLoggerFunction · 0.74
fakeFieldsFunction · 0.74
BenchmarkErrorFieldFunction · 0.68
TestSugarWithFunction · 0.68
TestNopLoggerFunction · 0.68
TestErrorConstructorsFunction · 0.68