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
Rate limiting has been applied.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new TooManyRequestsException with no detail message.TooManyRequestsException
(String message) Constructs a new TooManyRequestsException with the specified detail message.TooManyRequestsException
(String message, int retryAfter) Constructs a new TooManyRequestsException with the specified detail message and retry-after period.TooManyRequestsException
(String message, Throwable cause) Constructs a new TooManyRequestsException with the specified detail message and cause. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the number of seconds to wait before retrying the request.void
setRetryAfter
(int retryAfter) Sets the number of seconds to wait before retrying the request.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TooManyRequestsException
public TooManyRequestsException()Constructs a new TooManyRequestsException with no detail message. -
TooManyRequestsException
Constructs a new TooManyRequestsException with the specified detail message and retry-after period.- Parameters:
message
- the detail messageretryAfter
- number of seconds to wait before retrying
-
TooManyRequestsException
Constructs a new TooManyRequestsException with the specified detail message.- Parameters:
message
- the detail message
-
TooManyRequestsException
Constructs a new TooManyRequestsException with the specified detail message and cause.- Parameters:
message
- the detail messagecause
- 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
-