Package dev.reuss.tmdb.core.exception
Class TmdbApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.reuss.tmdb.core.exception.TmdbException
dev.reuss.tmdb.core.exception.TmdbApiException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TmdbNotFoundException,TmdbRateLimitException,TmdbServerException,TmdbUnauthorizedException
Exception thrown when TMDB returns an error response.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTmdbApiException(String message, int httpStatus, int tmdbStatusCode, String responseBody) Creates an API exception from TMDB response details. -
Method Summary
Modifier and TypeMethodDescriptionerror()Returns the known TMDB error matchingtmdbStatusCode().intReturns the HTTP status code.Returns the raw response body.intReturns the TMDB status code.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TmdbApiException
Creates an API exception from TMDB response details.- Parameters:
message- error messagehttpStatus- HTTP status codetmdbStatusCode- TMDB status code, or0if unavailableresponseBody- 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
0if unavailable
-
responseBody
Returns the raw response body.- Returns:
- raw response body
-
error
Returns the known TMDB error matchingtmdbStatusCode().- Returns:
- known TMDB error, if recognized
-