Class HttpException

    • Constructor Detail

      • HttpException

        protected HttpException​(int responseCode,
                                java.lang.String message,
                                java.lang.Throwable cause,
                                java.util.logging.Level logLevel)
      • HttpException

        protected HttpException​(int responseCode,
                                java.lang.String message,
                                java.lang.Throwable cause)
    • Method Detail

      • getResponseCode

        public final int getResponseCode()
      • getResponseCodeString

        public java.lang.String getResponseCodeString()
        Returns the string associated with a particular response code. Unlike Throwable.getMessage(), which is meant to describe the circumstances under which this particular exception occurred, this method always returns the same string (e.g. "Not Found" for a 400 error), and so should always be the same for a given subclass of HttpException.
      • send

        public final void send​(javax.servlet.http.HttpServletResponse rsp)
        Transmits the error response to the client.

        Throwable.getMessage() will be sent to the browser, whereas Throwable.toString() and Throwable.getCause() will be logged.