public class HttpException extends Exception
| Modifier and Type | Field and Description |
|---|---|
String |
message |
io.netty.handler.codec.http.HttpResponseStatus |
status |
| Constructor and Description |
|---|
HttpException(io.netty.handler.codec.http.HttpResponseStatus status,
String message)
Initialize the Exception with appropriate status code and a message
|
| Modifier and Type | Method and Description |
|---|---|
static HttpException |
conflict(String message)
Returns an Exception object that returns response with status
"409 Conflict" and a custom message
|
static HttpException |
forbidden(String message)
Returns an Exception object that returns response with status
"403 Forbidden" and a custom message
|
static HttpException |
internalServerError(String message)
Returns an Exception object that returns response with status
"500 Internal Server Error" and a custom message
|
static HttpException |
notFound(String message)
Raise to return response with status "404 Not Found" and a custom message
|
static HttpException |
unAuthorized(String message)
Returns an Exception object that returns response with status
"404 Not Found" and a custom message
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic io.netty.handler.codec.http.HttpResponseStatus status
public String message
public HttpException(io.netty.handler.codec.http.HttpResponseStatus status,
String message)
status - Status of the response.message - Message to be present in the response.HttpResponseStatuspublic static HttpException notFound(String message)
public static HttpException unAuthorized(String message)
public static HttpException forbidden(String message)
public static HttpException conflict(String message)
public static HttpException internalServerError(String message)
Copyright © 2017. All rights reserved.