interface RetryOptions

Configuration for automatic retry behavior.

Examples

Example 1

// Custom retry with rate-limit handling
{ attempts: 5, delay: (n, e) => e.isRateLimited ? e.retryAfter! * 1000 : 1000 * 2 ** n }

Properties

optional
attempts: number
optional
delay: number | ((
attempt: number,
error: HttpError,
) => number)
optional
when: (error: HttpError) => boolean

Usage

import { type RetryOptions } from ".";