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

Function init

pkg/ttnpb/errors.go:149–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147}
148
149func init() {
150 errors.ErrorDetailsToProto = func(e errors.ErrorDetails) proto.Message {
151 return ErrorDetailsToProto(e)
152 }
153 errors.ErrorDetailsFromProto = func(msg ...proto.Message) (details errors.ErrorDetails, rest []proto.Message) {
154 var detailsMsg *ErrorDetails
155 for _, msg := range msg {
156 switch msg := msg.(type) {
157 case *ErrorDetails:
158 detailsMsg = msg
159 default:
160 rest = append(rest, msg)
161 }
162 }
163 if detailsMsg != nil {
164 return ErrorDetailsFromProto(detailsMsg), rest
165 }
166 return nil, rest
167 }
168}
169
170type valueErr func(any) *errors.Error
171

Callers

nothing calls this directly

Calls 2

ErrorDetailsToProtoFunction · 0.85
ErrorDetailsFromProtoFunction · 0.85

Tested by

no test coverage detected