@cercalia/sdk
    Preparing search index...

    Function withRetry

    • Executes an async function with automatic retries.

      Type Parameters

      • T

      Parameters

      • fn: () => Promise<T>

        The async function to execute.

      • options: RetryOptions = {}

        Retry configuration options.

      Returns Promise<T>

      The result of the function if successful.

      Implements exponential backoff between retry attempts. Errors are silently retried up to maxAttempts times before being thrown.

      The last error if all attempts fail.