MCPcopy Create free account
hub / github.com/cozystack/talm / firstLookupError

Function firstLookupError

pkg/engine/lookup_classify.go:327–337  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

325// errors verbatim so classifyLookupError downstream can read the
326// gRPC status code without unwrapping noise.
327func 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

Calls

no outgoing calls