Options
All
  • Public
  • Public/Protected
  • All
Menu

Configuration of the retry middleware

Type parameters

  • TResponse

Hierarchy

  • RetryOptions

Index

Properties

Optional abortSignal

abortSignal: AbortSignal

Optional AbortSignal to abort the retry attempts.

computeDelay

computeDelay: function

Function to compute the delay in milliseconds before the next retry based on the number of attempts.

param

Current number of attempts, including the first attempt.

returns

Delay in milliseconds.

Type declaration

    • (attempt: number): number
    • Parameters

      • attempt: number

      Returns number

Optional maxAttempts

maxAttempts: number

Maximum number of retry attempts, starting from 1. Defaults to 3.

retryDecider

retryDecider: function

Function to decide if the request should be retried.

param

Optional response of the request.

param

Optional error thrown from previous attempts.

returns

True if the request should be retried.

Type declaration

    • (response?: TResponse, error?: unknown): Promise<boolean>
    • Parameters

      • Optional response: TResponse
      • Optional error: unknown

      Returns Promise<boolean>