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

Function setErrorDetails

pkg/errors/conversion.go:213–244  ·  view source on GitHub ↗
(err *Error, details ErrorDetails)

Source from the content-addressed store, hash-verified

211}
212
213func setErrorDetails(err *Error, details ErrorDetails) {
214 if err.Definition == nil {
215 err.Definition = &Definition{}
216 }
217 if namespace := details.Namespace(); namespace != "" {
218 err.namespace = namespace
219 }
220 if name := details.Name(); name != "" {
221 err.name = name
222 }
223 if messageFormat := details.MessageFormat(); messageFormat != "" {
224 err.messageFormat = messageFormat
225 err.messageFormatArguments = messageFormatArguments(messageFormat)
226 err.parsedMessageFormat, _ = formatter.Parse(messageFormat)
227 }
228 if attributes := details.PublicAttributes(); len(attributes) != 0 {
229 err.attributes = attributes
230 for attr := range attributes {
231 err.publicAttributes = append(err.publicAttributes, attr)
232 }
233 }
234 if correlationID := details.CorrelationID(); correlationID != "" {
235 err.correlationID = correlationID
236 }
237 if cause := details.Cause(); cause != nil {
238 err.cause, _ = From(cause)
239 }
240 if code := details.Code(); code != 0 {
241 err.code = code
242 }
243 err.details = append(err.details, details.Details()...)
244}
245
246func netErrorDetails(err net.Error) []any {
247 return []any{

Callers 2

FromGRPCStatusFunction · 0.85
FromFunction · 0.85

Calls 11

messageFormatArgumentsFunction · 0.85
FromFunction · 0.85
NamespaceMethod · 0.65
NameMethod · 0.65
MessageFormatMethod · 0.65
ParseMethod · 0.65
PublicAttributesMethod · 0.65
CorrelationIDMethod · 0.65
CauseMethod · 0.65
CodeMethod · 0.65
DetailsMethod · 0.65

Tested by

no test coverage detected