Package com.jsgalactic.axiom.error
Class TooManyRequestsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.jsgalactic.axiom.error.AxiomException
com.jsgalactic.axiom.error.TooManyRequestsException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionCreates the exception with codetoo_many_requestsand no Retry-After header.TooManyRequestsException(Duration retryAfter) Creates the exception with a Retry-After delay.TooManyRequestsException(Duration retryAfter, String code) Creates the exception with a Retry-After delay and a specific safe code. -
Method Summary
Methods inherited from class com.jsgalactic.axiom.error.AxiomException
code, headers, status, violationsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TooManyRequestsException
public TooManyRequestsException()Creates the exception with codetoo_many_requestsand no Retry-After header. -
TooManyRequestsException
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
Creates the exception with a Retry-After delay and a specific safe code.- Parameters:
retryAfter- non-negative delay of at most one daycode- machine-readable code- Throws:
IllegalArgumentException- for a negative or longer delay
-