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
ConstructorsConstructorDescriptionRateLimitException(long limit, long remaining, long reset) RateLimitException(long limit, long remaining, long reset, Map<String, Object> values) -
Method Summary
Modifier and TypeMethodDescriptionlonggetLimit()Getter for the maximum number of requests available in the current time frame.longGetter for the number of remaining requests in the current time frame.longgetReset()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, isVerificationRequiredMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RateLimitException
-
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.
-