Class APIException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.github.m0nk3y2k4.thetvdb.api.exception.APIException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
APICommunicationException
public class APIException extends Exception
Main type for all checked exceptions related to the API functionality. This includes specific errors as defined by the remote service as well as general problems like communication issues or malformed API responses.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
API_BAD_METHOD_ERROR
Indicates that the requested resource is known by the server but has to be accessed with different settingsstatic String
API_CONFLICT_ERROR
Indicates that a requested record could not be updated or deletedstatic String
API_JSON_PARSE_ERROR
Indicates that a malformed JSON response was received from the remote servicestatic String
API_NOT_AUTHORIZED_ERROR
Indicates that an attempt to communicate with some API route was made without proper authorizationstatic String
API_NOT_FOUND_ERROR
Indicates that the requested resource is unknown for the remote service (e.g. wrong seriesId)static String
API_SERVICE_UNAVAILABLE
Indicates that the remote service is currently unavailable e.g. due to maintenance or server issues
-
Constructor Summary
Constructors Constructor Description APIException(String message)
Creates a new checked API exception with the given error messageAPIException(String message, String details)
Creates a new checked API exception with an extended error messageAPIException(String message, Throwable cause)
Creates a nested checked API exception wrapping some other root exception
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
API_NOT_AUTHORIZED_ERROR
public static final String API_NOT_AUTHORIZED_ERROR
Indicates that an attempt to communicate with some API route was made without proper authorization- See Also:
- Constant Field Values
-
API_NOT_FOUND_ERROR
public static final String API_NOT_FOUND_ERROR
Indicates that the requested resource is unknown for the remote service (e.g. wrong seriesId)- See Also:
- Constant Field Values
-
API_BAD_METHOD_ERROR
public static final String API_BAD_METHOD_ERROR
Indicates that the requested resource is known by the server but has to be accessed with different settings- See Also:
- Constant Field Values
-
API_CONFLICT_ERROR
public static final String API_CONFLICT_ERROR
Indicates that a requested record could not be updated or deleted- See Also:
- Constant Field Values
-
API_SERVICE_UNAVAILABLE
public static final String API_SERVICE_UNAVAILABLE
Indicates that the remote service is currently unavailable e.g. due to maintenance or server issues- See Also:
- Constant Field Values
-
API_JSON_PARSE_ERROR
public static final String API_JSON_PARSE_ERROR
Indicates that a malformed JSON response was received from the remote service- See Also:
- Constant Field Values
-
-
Constructor Detail
-
APIException
public APIException(String message)
Creates a new checked API exception with the given error message- Parameters:
message
- Brief error message describing the general problem
-
APIException
public APIException(@Nonnull String message, @Nonnull String details)
Creates a new checked API exception with an extended error message- Parameters:
message
- Brief error message describing the general problem. This message may contain a single %s conversion which will be automatically replaced with the givendetails
message text.details
- A more detailed error description
-
-