All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clarifai.api.exception.ClarifaiThrottledException Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package com.clarifai.api.exception;

/**
 * Thrown when the client is making too many requests. The client should wait for the time returned
 * by @{link {@link #getWaitSeconds()} before continuing to send requests.
 */
public class ClarifaiThrottledException extends ClarifaiException {
  private static final long serialVersionUID = 1L;
  private final int waitSeconds;

  public ClarifaiThrottledException(String message, int waitSeconds) {
    super(message == null ? "Throttled" : message);
    this.waitSeconds = waitSeconds;
  }

  /** @return the number of seconds to wait before sending more requests. */
  public int getWaitSeconds() {
    return waitSeconds;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy