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

Method PublicAttributes

pkg/errors/attributes.go:132–153  ·  view source on GitHub ↗

PublicAttributes of the error.

()

Source from the content-addressed store, hash-verified

130
131// PublicAttributes of the error.
132func (e *Error) PublicAttributes() map[string]any {
133 if e == nil {
134 return nil
135 }
136 if len(e.attributes) == 0 {
137 return nil
138 }
139 publicAttributes := make(map[string]any, len(e.attributes))
140nextAttr:
141 for k, v := range e.attributes {
142 for _, public := range e.publicAttributes {
143 if k == public {
144 publicAttributes[k] = v
145 continue nextAttr
146 }
147 }
148 }
149 if len(publicAttributes) == 0 {
150 return nil
151 }
152 return publicAttributes
153}
154
155// Attributes are not present in the error definition, so this just returns nil.
156func (*Definition) Attributes() map[string]any { return nil }

Callers 1

StringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected