Class HttpException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    HttpInternalErrorException, HttpNotFoundException

    public class HttpException
    extends java.lang.RuntimeException
    This exception is thrown when an Http error (response code 4xx or 5xx) is detected.
    Author:
    Seth Ladd, Russell Gold
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HttpException​(int responseCode)
      throw a http Exception with the given responseCode
      protected HttpException​(int responseCode, java.lang.String responseMessage, java.net.URL baseURL)
      throw a http Exception with the given responseCode and Message and base url
      protected HttpException​(int responseCode, java.lang.String responseMessage, java.net.URL baseURL, java.lang.Throwable cause)
      throw a http Exception with the given responseCode and Message, base url and cause
      protected HttpException​(int responseCode, java.lang.Throwable cause)
      throw a http Exception with the given responseCode and cause
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()
      get the cause (if any)
      java.lang.String getMessage()
      get the Message for the http Exception
      int getResponseCode()
      get the response Code of this http Exception
      java.lang.String getResponseMessage()
      get the response Message of this http Exception
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HttpException

        protected HttpException​(int responseCode)
        throw a http Exception with the given responseCode
        Parameters:
        responseCode -
      • HttpException

        protected HttpException​(int responseCode,
                                java.lang.Throwable cause)
        throw a http Exception with the given responseCode and cause
        Parameters:
        responseCode -
        cause -
      • HttpException

        protected HttpException​(int responseCode,
                                java.lang.String responseMessage,
                                java.net.URL baseURL)
        throw a http Exception with the given responseCode and Message and base url
        Parameters:
        responseCode -
        responseMessage -
        baseURL -
      • HttpException

        protected HttpException​(int responseCode,
                                java.lang.String responseMessage,
                                java.net.URL baseURL,
                                java.lang.Throwable cause)
        throw a http Exception with the given responseCode and Message, base url and cause
        Parameters:
        responseCode -
        responseMessage -
        baseURL -
        cause -
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        get the Message for the http Exception
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        - the message of the Exception
      • getResponseCode

        public int getResponseCode()
        get the response Code of this http Exception
        Returns:
        - the response Code code 4xx or 5xx
      • getResponseMessage

        public java.lang.String getResponseMessage()
        get the response Message of this http Exception
        Returns:
        the response message
      • getCause

        public java.lang.Throwable getCause()
        get the cause (if any)
        Overrides:
        getCause in class java.lang.Throwable