Proton Drive CLI API Documentation - v0.1.2
    Preparing search index...

    Function retryWithBackoff

    • Execute an async operation with automatic retry on transient failures.

      NEVER retries:

      • Rate-limit errors (code 2028, 85131, HTTP 429)
      • CAPTCHA errors (code 9001, 12087)
      • Permanent errors (4xx client errors except 408)

      DOES retry:

      • Network errors (ECONNRESET, ETIMEDOUT, ENOTFOUND)
      • Server errors (5xx)
      • Timeout errors (408, ECONNABORTED)
      • Custom retryable errors in config

      Type Parameters

      • T

      Parameters

      • operation: () => Promise<T>

        Async function to execute

      • config: RetryConfig = DEFAULT_RETRY_CONFIG

        Retry configuration (uses DEFAULT_RETRY_CONFIG if not provided)

      • context: string = 'Operation'

        Human-readable context for logging (e.g., "Upload file abc.txt")

      Returns Promise<T>

      Promise resolving to operation result

      Last error if all retry attempts fail