MCPcopy Index your code
hub / github.com/docker/docker-agent / matchesTransientPattern

Function matchesTransientPattern

pkg/modelerrors/modelerrors.go:368–379  ·  view source on GitHub ↗

matchesTransientPattern reports whether the error's message matches one of [transientStatusCodePatterns]. Used to override an otherwise non-retryable HTTP status classification. Patterns are pre-lowercased (enforced by declaration convention) and additionally lowercased here for defence in depth, so

(err error)

Source from the content-addressed store, hash-verified

366// declaration convention) and additionally lowercased here for defence in
367// depth, so a mixed-case pattern slipping into the list will still match.
368func matchesTransientPattern(err error) bool {
369 if err == nil {
370 return false
371 }
372 msg := strings.ToLower(err.Error())
373 for _, p := range transientStatusCodePatterns {
374 if strings.Contains(msg, strings.ToLower(p)) {
375 return true
376 }
377 }
378 return false
379}
380
381// retryablePatterns contains error message substrings that indicate a
382// transient/retryable failure. Numeric status codes (500, 502, etc.) are

Callers 3

isRetryableModelErrorFunction · 0.85
ClassifyModelErrorFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by 1