Skip to content

retryRequest

retryRequest<Answer>(send, options): Promise<Answer>

Calls send up to 3 times, trying again after a 500, 502, 503, 504 or 408 answer or a connection failure before an answer, never after an abort or a timeout. Waits up to 250 ms, then up to 1 s, at random, and reports each retry as <name>.request.retried. Resolves with the last answer or rejects with the last error, unchanged.

Type Parameter
Answer
Parameter Type
send () => Promise<Answer>
options RetryOptions

Promise<Answer>