Class TooManyRequestsException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.hc.core5.http.HttpException
se.michaelthelin.spotify.exceptions.SpotifyWebApiException
se.michaelthelin.spotify.exceptions.detailed.TooManyRequestsException
All Implemented Interfaces:
Serializable

public class TooManyRequestsException extends SpotifyWebApiException
Rate limiting has been applied.
See Also:
  • Constructor Details

    • TooManyRequestsException

      public TooManyRequestsException()
      Constructs a new TooManyRequestsException with no detail message.
    • TooManyRequestsException

      public TooManyRequestsException(String message, int retryAfter)
      Constructs a new TooManyRequestsException with the specified detail message and retry-after period.
      Parameters:
      message - the detail message
      retryAfter - number of seconds to wait before retrying
    • TooManyRequestsException

      public TooManyRequestsException(String message)
      Constructs a new TooManyRequestsException with the specified detail message.
      Parameters:
      message - the detail message
    • TooManyRequestsException

      public TooManyRequestsException(String message, Throwable cause)
      Constructs a new TooManyRequestsException with the specified detail message and cause.
      Parameters:
      message - the detail message
      cause - the cause of this exception
  • Method Details

    • getRetryAfter

      public int getRetryAfter()
      Gets the number of seconds to wait before retrying the request.
      Returns:
      the retry-after period in seconds
    • setRetryAfter

      public void setRetryAfter(int retryAfter)
      Sets the number of seconds to wait before retrying the request.
      Parameters:
      retryAfter - the retry-after period in seconds