Package dev.reuss.tmdb.core.exception
Class TmdbExceptions
java.lang.Object
dev.reuss.tmdb.core.exception.TmdbExceptions
Factory methods for mapping TMDB response status values to SDK exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TmdbApiExceptionCreates the most specific API exception for a parsed TMDB error response.static TmdbApiExceptionfromHttpStatus(int httpStatus, String message, String responseBody) Creates the most specific API exception for an HTTP error without a parsed TMDB status code.
-
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 codetmdbStatusCode- TMDB status codetmdbStatusMessage- TMDB status messageresponseBody- raw response body- Returns:
- mapped API exception
-
fromHttpStatus
Creates the most specific API exception for an HTTP error without a parsed TMDB status code.- Parameters:
httpStatus- HTTP status codemessage- error messageresponseBody- raw response body- Returns:
- mapped API exception
-