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

Method WithAttributes

pkg/errors/attributes.go:104–111  ·  view source on GitHub ↗

WithAttributes returns the error with the given attributes set. Any conflicting attributes in the Error will be overwritten.

(kv ...any)

Source from the content-addressed store, hash-verified

102// WithAttributes returns the error with the given attributes set.
103// Any conflicting attributes in the Error will be overwritten.
104func (e *Error) WithAttributes(kv ...any) *Error {
105 if e == nil {
106 return e
107 }
108 deriv := *e
109 deriv.mergeAttributes(kv...)
110 return &deriv
111}
112
113// WithAttributes returns a new error from the definition, and sets the given attributes.
114func (d *Definition) WithAttributes(kv ...any) *Error {

Callers 15

FromFunction · 0.95
FileMethod · 0.45
FileMethod · 0.45
FileMethod · 0.45
FileMethod · 0.45
readMethod · 0.45
appendMethod · 0.45
unexpectedValueFunction · 0.45
errExpectedLowerOrEqualFunction · 0.45
errExpectedLengthEqualFunction · 0.45

Calls 1

mergeAttributesMethod · 0.80

Tested by 15

TestMarshalFunction · 0.36
TestParseChMaskFunction · 0.36
TestEncodeDownlinkFunction · 0.36
TestDecodeUplinkFunction · 0.36
TestDecodeDownlinkFunction · 0.36
TestUplinkFunction · 0.36
TestProcessDownlinkTaskFunction · 0.36
TestHandleDutyCycleAnsFunction · 0.36