Stone.js API
    Preparing search index...

    Raised when a caller has spent its budget.

    It declares its own status, 429, because this module knows nothing about the platform answering: the HTTP error handler honours a declared status, and a CLI or a queue consumer reads the error itself. Retry-After travels with it, since a refusal that does not say when to come back invites exactly the retry storm the limit exists to stop.

    Hierarchy

    • IntegrationError
      • RateLimitError
    Index
    cause?: Error
    code?: string
    headers: Record<string, string>
    limit: number

    The limit that was exceeded.

    metadata?: unknown
    resetAt: number

    Epoch ms at which the window resets.

    retryAfter: number

    Seconds to wait before retrying.

    statusCode: 429
    statusMessage: "Too Many Requests" = 'Too Many Requests'
    • Converts the error to a formatted string representation.

      Parameters

      • Optionalmultiline: boolean

        Determine if output value must be multiline or not.

      Returns string

      A formatted error string.

    • Create a RuntimeError.

      Type Parameters

      • T extends RuntimeError = RuntimeError

      Parameters

      • message: string
      • Optionaloptions: ErrorOptions

        The options to create a RuntimeError.

      Returns T

      A new RuntimeError instance.