MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Fields

Method Fields

pkg/errors/errors.go:67–79  ·  view source on GitHub ↗

Fields implements the log.Fielder interface.

()

Source from the content-addressed store, hash-verified

65
66// Fields implements the log.Fielder interface.
67func (e *Error) Fields() map[string]any {
68 if e == nil {
69 return nil
70 }
71 res := make(map[string]any)
72 pref := "error_cause"
73 for cause := Cause(e); cause != nil; cause = Cause(cause) {
74 res[pref] = cause.Error()
75 pref += "_cause"
76 }
77 maps.Copy(res, Attributes(Stack(e)...))
78 return res
79}
80
81// Interface is the interface of an error.
82type Interface interface {

Callers

nothing calls this directly

Calls 5

CauseFunction · 0.85
AttributesFunction · 0.85
StackFunction · 0.70
ErrorMethod · 0.65
CopyMethod · 0.45

Tested by

no test coverage detected