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

Method WithError

pkg/log/fields.go:113–121  ·  view source on GitHub ↗

WithError returns new fields that contain the passed error and all its fields (if any).

(err error)

Source from the content-addressed store, hash-verified

111
112// WithError returns new fields that contain the passed error and all its fields (if any).
113func (f *F) WithError(err error) *F {
114 res := f.WithField("error", err)
115
116 if fld, ok := err.(Fielder); ok {
117 return res.With(fld.Fields())
118 }
119
120 return res
121}

Callers

nothing calls this directly

Calls 3

WithFieldMethod · 0.95
WithMethod · 0.65
FieldsMethod · 0.65

Tested by

no test coverage detected