Graphorin API reference v0.15.1
Graphorin API reference / @graphorin/provider / / isRetryableProviderFailure
Function: isRetryableProviderFailure()
ts
function isRetryableProviderFailure(err): boolean;Defined in: packages/provider/src/errors/retryability.ts:66
Stable
Classify a thrown provider error as retryable (also fallback-eligible) or terminal.
Decision order:
- Non-object throws are never retryable.
- An aborted request is never retryable, even when it surfaces as a
status: 0network error. The retry loop also short-circuits onreq.signal?.aborted, but the predicate must exclude abort independently so an internally-aborted call is not retried. - The canonical kind decides when recognised.
ProviderHttpError.kindis always the stable'provider-http'discriminant; the mapped canonical kind rides onerrorKind- both are consulted. Transient kinds (transient,rate-limit,rate-limit-exceeded,capacity) are retryable; terminal kinds (unauthorized,invalid-request,context-length,content-filter) are not. - HTTP status fallback for errors without a recognised kind:
429and5xxretry;status: 0is a fetch-level network failure (ECONNREFUSED, DNS, connection reset, request timeout) - exactly the transient classwithRetrydocuments - and retries (abort already excluded above).
Parameters
| Parameter | Type |
|---|---|
err | unknown |
Returns
boolean