Options
All
  • Public
  • Public/Protected
  • All
Menu

Configuration for the Gaxios request method.

Hierarchy

  • RetryConfig

Index

Properties

currentRetryAttempt?: number

The number of retries already attempted.

httpMethodsToRetry?: string[]

The HTTP Methods that will be automatically retried. Defaults to ['GET','PUT','HEAD','OPTIONS','DELETE']

noResponseRetries?: number

When there is no response, the number of retries to attempt. Defaults to 2.

retry?: number

The number of times to retry the request. Defaults to 3.

retryDelay?: number

The amount of time to initially delay the retry, in ms. Defaults to 100ms.

statusCodesToRetry?: number[][]

The HTTP response status codes that will automatically be retried. Defaults to: [[100, 199], [429, 429], [500, 599]]

Methods

  • onRetryAttempt(err: GaxiosError<any>): void | Promise<void>
  • Function to invoke when a retry attempt is made.

    Parameters

    Returns void | Promise<void>

  • retryBackoff(err: GaxiosError<any>, defaultBackoffMs: number): Promise<void>
  • Function to invoke which returns a promise. After the promise resolves, the retry will be triggered. If provided, this will be used in-place of the retryDelay

    Parameters

    Returns Promise<void>

  • shouldRetry(err: GaxiosError<any>): boolean | Promise<boolean>
  • Function to invoke which determines if you should retry

    Parameters

    Returns boolean | Promise<boolean>