MCPcopy Create free account
hub / github.com/Effect-TS/effect / onFailure

Function onFailure

packages/effect/src/http/HttpClient.ts:1493–1501  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

1491 })
1492 },
1493 onFailure(error) {
1494 if (isTooManyRequestsHttpClientError(error)) {
1495 return Effect.flatMap(
1496 inspectResponse(error.reason.response, adaptive),
1497 (retryAfter) => canRetry ? retry(retryAfter) : Effect.fail(error)
1498 )
1499 }
1500 return Effect.fail(error)
1501 }
1502 })
1503 return adaptive === undefined || Duration.isZero(adaptive.delay)
1504 ? request

Callers

nothing calls this directly

Calls 4

inspectResponseFunction · 0.85
retryFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected