Class TmdbApiException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TmdbNotFoundException, TmdbRateLimitException, TmdbServerException, TmdbUnauthorizedException

public class TmdbApiException extends TmdbException
Exception thrown when TMDB returns an error response.
See Also:
  • Constructor Details

    • TmdbApiException

      public TmdbApiException(String message, int httpStatus, int tmdbStatusCode, String responseBody)
      Creates an API exception from TMDB response details.
      Parameters:
      message - error message
      httpStatus - HTTP status code
      tmdbStatusCode - TMDB status code, or 0 if unavailable
      responseBody - raw response body
  • Method Details

    • httpStatus

      public int httpStatus()
      Returns the HTTP status code.
      Returns:
      HTTP status code
    • tmdbStatusCode

      public int tmdbStatusCode()
      Returns the TMDB status code.
      Returns:
      TMDB status code, or 0 if unavailable
    • responseBody

      public String responseBody()
      Returns the raw response body.
      Returns:
      raw response body
    • error

      public Optional<TmdbError> error()
      Returns the known TMDB error matching tmdbStatusCode().
      Returns:
      known TMDB error, if recognized