Class TooManyRequestsException

All Implemented Interfaces:
Serializable

public class TooManyRequestsException extends AxiomException
A caller that sent too many requests in a given time (429). An optional delay is sent as Retry-After in whole seconds, rounded up.
See Also:
  • Constructor Details

    • TooManyRequestsException

      public TooManyRequestsException()
      Creates the exception with code too_many_requests and no Retry-After header.
    • TooManyRequestsException

      public TooManyRequestsException(Duration retryAfter)
      Creates the exception with a Retry-After delay.
      Parameters:
      retryAfter - non-negative delay of at most one day
      Throws:
      IllegalArgumentException - for a negative or longer delay
    • TooManyRequestsException

      public TooManyRequestsException(Duration retryAfter, String code)
      Creates the exception with a Retry-After delay and a specific safe code.
      Parameters:
      retryAfter - non-negative delay of at most one day
      code - machine-readable code
      Throws:
      IllegalArgumentException - for a negative or longer delay