Package io.vertx.ext.web.handler
Class HttpException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.vertx.ext.web.handler.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 is500
. 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 usingHttpResponseStatus
.- Author:
- Paulo Lopes
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HttpException()
HttpException(int statusCode)
HttpException(int statusCode, String payload)
HttpException(int statusCode, String payload, Throwable cause)
HttpException(int statusCode, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getPayload()
int
getStatusCode()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
-
getPayload
public String getPayload()
-
-