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

Function PublicAttributes

pkg/errors/attributes.go:179–191  ·  view source on GitHub ↗

PublicAttributes returns the public attributes of the errors, if they implement PublicAttributes(). If more than one error is passed, subsequent error attributes will be added if not set.

(err ...error)

Source from the content-addressed store, hash-verified

177// PublicAttributes returns the public attributes of the errors, if they implement PublicAttributes().
178// If more than one error is passed, subsequent error attributes will be added if not set.
179func PublicAttributes(err ...error) map[string]any {
180 attributes := make(map[string]any)
181 for _, err := range err {
182 if attrErr := (publicAttributer)(nil); errors.As(err, &attrErr) {
183 for k, v := range attrErr.PublicAttributes() {
184 if _, ok := attributes[k]; !ok {
185 attributes[k] = v
186 }
187 }
188 }
189 }
190 return attributes
191}

Callers 1

TestAttributesErrorFunction · 0.92

Calls 2

PublicAttributesMethod · 0.65
AsMethod · 0.45

Tested by 1

TestAttributesErrorFunction · 0.74