Class RateLimitException

All Implemented Interfaces:
Serializable

public class RateLimitException extends APIException
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 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.