Graphorin API reference v0.15.1
Graphorin API reference / @graphorin/provider / / readRetryAfterMs
Function: readRetryAfterMs()
ts
function readRetryAfterMs(err): number | null;Defined in: packages/provider/src/errors/retryability.ts:98
Stable
Read a Retry-After hint from a thrown error. Recognises:
- errors carrying a
retryAfterMsfield (already milliseconds) -RateLimitExceededErrorandProviderHttpErrorwith a numericRetry-Afterresponse header both stamp it; - errors carrying a
retryAfterSecondsnumeric field; - HTTP-shaped errors carrying a
headers['retry-after']value (numeric seconds, or an HTTP-date resolved against the current clock).
Returns the resolved delay in milliseconds or null when no hint is available. withRetry consumes this to honour server-provided backoff over its own schedule.
Parameters
| Parameter | Type |
|---|---|
err | unknown |
Returns
number | null