Class 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 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 given details message text.
        details - A more detailed error description
      • APIException

        public APIException​(String message,
                            Throwable cause)
        Creates a nested checked API exception wrapping some other root exception
        Parameters:
        message - Brief error message describing the general problem
        cause - The original root exception