Class TmdbExceptions

java.lang.Object
dev.reuss.tmdb.core.exception.TmdbExceptions

public final class TmdbExceptions extends Object
Factory methods for mapping TMDB response status values to SDK exceptions.
  • Method Details

    • from

      public static TmdbApiException from(int httpStatus, int tmdbStatusCode, String tmdbStatusMessage, String responseBody)
      Creates the most specific API exception for a parsed TMDB error response.
      Parameters:
      httpStatus - HTTP status code
      tmdbStatusCode - TMDB status code
      tmdbStatusMessage - TMDB status message
      responseBody - raw response body
      Returns:
      mapped API exception
    • fromHttpStatus

      public static TmdbApiException fromHttpStatus(int httpStatus, String message, String responseBody)
      Creates the most specific API exception for an HTTP error without a parsed TMDB status code.
      Parameters:
      httpStatus - HTTP status code
      message - error message
      responseBody - raw response body
      Returns:
      mapped API exception