EU Parliament Monitor - API Documentation - v0.8.2
    Preparing search index...

    Function withRetry

    • Execute an async function with retry and exponential backoff.

      Retries up to policy.maxRetries times with capped exponential delay: min(baseDelayMs * 2^attempt, maxDelayMs).

      Type Parameters

      • T

      Parameters

      • fn: () => Promise<T>

        Async factory that performs the operation

      • policy: MCPRetryPolicy = {}

        Retry configuration (merged with defaults)

      Returns Promise<T>

      Result of fn on first success

      The last error when all retries are exhausted