MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / isRetryableHTTPError

Function isRetryableHTTPError

api/client.go:241–256  ·  view source on GitHub ↗
(statusCode int, errorText string, cfg RetryConfig)

Source from the content-addressed store, hash-verified

239 for attempt := 0; attempt <= cfg.MaxRetries; attempt++ {
240 if !waitProviderCooldown(ctx, cooldownKey) {
241 return nil, ctx.Err()
242 }
243 reqCtx, cancel := context.WithTimeout(ctx, timeout)
244 resp, err := makeRequest(reqCtx, c.HTTPClient)
245
246 if err != nil {
247 cancel()
248 lastErr = err
249 if attempt < cfg.MaxRetries {
250 if !sleepBackoff(ctx, attempt, cfg) {
251 return nil, ctx.Err()
252 }
253 continue
254 }
255 break
256 }
257
258 if resp == nil {
259 cancel()

Callers 1

RetryRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected