Package com.auth0.exception
Class RateLimitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.auth0.exception.Auth0Exception
com.auth0.exception.APIException
com.auth0.exception.RateLimitException
- All Implemented Interfaces:
Serializable
Represents a server error when a rate limit has been exceeded.
Getters for limit, remaining
and reset
corresponds to X-RateLimit-Limit, X-RateLimit-Remaining
and X-RateLimit-Reset
HTTP headers.
If the value of any headers is missing, then a default value -1 will assigned.
To learn more about rate limits, visit https://auth0.com/docs/policies/rate-limits
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
getLimit()
Getter for the maximum number of requests available in the current time frame.long
Getter for the number of remaining requests in the current time frame.long
getReset()
Getter for the UNIX timestamp of the expected time when the rate limit will reset.Methods inherited from class com.auth0.exception.APIException
getDescription, getError, getStatusCode, getValue, isAccessDenied, isInvalidCredentials, isMultifactorEnrollRequired, isMultifactorRequired, isMultifactorTokenInvalid, isVerificationRequired
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RateLimitException
public RateLimitException(long limit, long remaining, long reset)
-
-
Method Details
-
getLimit
public long getLimit()Getter for the maximum number of requests available in the current time frame.- Returns:
- The maximum number of requests or -1 if missing.
-
getRemaining
public long getRemaining()Getter for the number of remaining requests in the current time frame.- Returns:
- Number of remaining requests or -1 if missing.
-
getReset
public long getReset()Getter for the UNIX timestamp of the expected time when the rate limit will reset.- Returns:
- The UNIX timestamp or -1 if missing.
-