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

com.sendgrid.RateLimitException Maven / Gradle / Ivy

Go to download

This Java module allows you to quickly and easily send emails through Twilio SendGrid using Java.

There is a newer version: 5.0.0-rc.1
Show newest version
package com.sendgrid;

/**
 * An exception thrown when the maximum number of retries have occurred, and the API calls are still
 * rate limited.
 */
public class RateLimitException extends Exception {

  private final Request request;
  private final int retryCount;

  /**
   * Construct a new exception.
   *
   * @param request the originating request object.
   * @param retryCount the number of times a retry was attempted.
   */
  public RateLimitException(Request request, int retryCount) {
    this.request = request;
    this.retryCount = retryCount;
  }

  /**
   * Get the originating request object.
   *
   * @return the request object.
   */
  public Request getRequest() {
    return this.request;
  }

  /**
   * Get the number of times the action was attemted.
   *
   * @return the retry count.
   */
  public int getRetryCount() {
    return this.retryCount;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy