(err *Error, details ErrorDetails)
| 211 | } |
| 212 | |
| 213 | func 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 | |
| 246 | func netErrorDetails(err net.Error) []any { |
| 247 | return []any{ |
no test coverage detected