Class HttpException

  • All Implemented Interfaces:
    Serializable

    public final class HttpException
    extends RuntimeException
    An utility exception class to signal HTTP failures. The class with convey an http status code, by default is is 500. The exception may contain a cause throwable and for special cases a simple payload string may be added for context. The payload can be used for example perform a redirect. The message for the exception is inferred from the standard http error code using HttpResponseStatus.
    Author:
    Paulo Lopes
    See Also:
    Serialized Form
    • Constructor Detail

      • HttpException

        public HttpException()
      • HttpException

        public HttpException​(int statusCode)
      • HttpException

        public HttpException​(int statusCode,
                             Throwable cause)
      • HttpException

        public HttpException​(int statusCode,
                             String payload)
      • HttpException

        public HttpException​(int statusCode,
                             String payload,
                             Throwable cause)
    • Method Detail

      • getStatusCode

        public int getStatusCode()
      • getPayload

        public String getPayload()