Class SpotifyWebApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.hc.core5.http.HttpException
se.michaelthelin.spotify.exceptions.SpotifyWebApiException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadGatewayException, BadRequestException, ForbiddenException, InternalServerErrorException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException

public class SpotifyWebApiException extends org.apache.hc.core5.http.HttpException
An exception happened, eg. a HTTP status code 4** or 5** has been returned in a request.
See Also:
  • Constructor Details

    • SpotifyWebApiException

      public SpotifyWebApiException()
      Creates a new SpotifyWebApiException with no detail message.
    • SpotifyWebApiException

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

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

    • getReason

      public String getReason()
      Gets the reason from a player error response, e.g. PREMIUM_REQUIRED or NO_ACTIVE_DEVICE.
      Returns:
      the reason, or null if the error response did not contain one
    • setReason

      public void setReason(String reason)
      Sets the reason from a player error response.
      Parameters:
      reason - the reason