firstLookupError picks the most operator-relevant error from the two paths through which `helpers.ForEachResource` reports failure: the direct return value (resource-definition resolution against the first endpoint) and the per-node multierror that accumulates callback failures (per-node dial issues
(helperErr error, multiErr *multierror.Error)
| 325 | // errors verbatim so classifyLookupError downstream can read the |
| 326 | // gRPC status code without unwrapping noise. |
| 327 | func firstLookupError(helperErr error, multiErr *multierror.Error) error { |
| 328 | if helperErr != nil { |
| 329 | return helperErr |
| 330 | } |
| 331 | |
| 332 | if multiErr == nil || len(multiErr.Errors) == 0 { |
| 333 | return nil |
| 334 | } |
| 335 | |
| 336 | return multiErr.Errors[len(multiErr.Errors)-1] |
| 337 | } |
| 338 | |
| 339 | // retryableLookupError reports whether a failure class is worth |
| 340 | // retrying. Only transient connectivity failures qualify: refused |
no outgoing calls