Class RateLimitException

All Implemented Interfaces:
Serializable

public class RateLimitException extends TnsAIException
Exception for rate limit errors (HTTP 429, quota exceeded). Retryable after waiting for the suggested delay.
See Also:
  • Constructor Details

    • RateLimitException

      public RateLimitException(String message)
    • RateLimitException

      public RateLimitException(String message, Long retryAfterMs)
    • RateLimitException

      public RateLimitException(String service, Long retryAfterMs, Integer remainingQuota)
  • Method Details

    • getRetryAfterMs

      public Long getRetryAfterMs()
    • getService

      public String getService()
    • getRemainingQuota

      public Integer getRemainingQuota()
    • getSuggestedRetryDelayMs

      public long getSuggestedRetryDelayMs()
      Description copied from class: TnsAIException
      Gets suggested retry delay in milliseconds. Override in subclasses for specific retry strategies.
      Overrides:
      getSuggestedRetryDelayMs in class TnsAIException
    • getMaxRetryAttempts

      public int getMaxRetryAttempts()
      Description copied from class: TnsAIException
      Gets maximum recommended retry attempts.
      Overrides:
      getMaxRetryAttempts in class TnsAIException
    • fromHttp429

      public static RateLimitException fromHttp429(String service, String retryAfterHeader)
      Factory method for HTTP 429 responses.
    • llmQuotaExceeded

      public static RateLimitException llmQuotaExceeded(String model)
      Factory method for LLM quota exceeded.
    • apiRateLimit

      public static RateLimitException apiRateLimit(String endpoint, long retryAfterMs)
      Factory method for API rate limit.