sendgrid/RateLimitException.java

sendgrid-java · src/main/java/com/sendgrid/RateLimitException.java · java · MIT
email

Exception thrown when SendGrid API rate limits are exceeded after retries.

// Source: https://github.com/sendgrid/sendgrid-java | License: MIT | Copyright 2026, Twilio SendGrid, Inc. <help@twilio.com>
// Provided via justclaw.it.com; keep this notice with the code.
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 objec

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key