Skip to content

RetryEvent

RetryEvent<E> = object

Defined in: Types/RetryPolicy.ts:18

Observational telemetry event emitted immediately before each retry delay.

Provides context on the current attempt count, the error that triggered the retry, and the calculated backoff delay before the next attempt executes.

RetryPolicy for configuring retry attempts and backoff strategies.

const onRetry = (event: RetryEvent<Error>) => {
  console.warn(`Attempt ${event.attempt} failed: ${event.error.message}. Retrying in ${Duration.to.milliseconds(event.delay)}ms.`);
};

E = unknown

readonly attempt: number

Defined in: Types/RetryPolicy.ts:18


readonly delay: Duration

Defined in: Types/RetryPolicy.ts:18


readonly error: E

Defined in: Types/RetryPolicy.ts:18