com.github.jamesnetherton.zulip.client.exception.ZulipRateLimitExceededException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zulip-java-client Show documentation
Show all versions of zulip-java-client Show documentation
Java client for the Zulip REST API
The newest version!
package com.github.jamesnetherton.zulip.client.exception;
/**
* Thrown when the Zulip server returns an HTTP response code of 429. Indicating that the
* request rate limit has been reached.
*/
public class ZulipRateLimitExceededException extends Exception {
private final long reteLimitReset;
/**
* Constructs a {@link ZulipRateLimitExceededException}.
*
* @param rateLimitReset The time represented as a Unix time, at which the Zulip rate limit will be reset
*/
public ZulipRateLimitExceededException(long rateLimitReset) {
super("Rate limit exceeded");
this.reteLimitReset = rateLimitReset;
}
/**
* Gets the time at which the Zulip rate limit will be reset. The time is in the format of
* Unix epoch.
*
* @return The rate limit reset time
*/
public long getReteLimitReset() {
return reteLimitReset;
}
}