.. java:import:: java.lang Exception .. java:import:: io.netty.handler.codec.http HttpResponseStatus HttpException ============= .. java:package:: io.aalam.common :noindex: .. java:type:: public class HttpException extends Exception The http exception objects are thrown by the action handler when it wishes to abort the processing when it faces an error. Fields ------ message ^^^^^^^ .. java:field:: public String message :outertype: HttpException status ^^^^^^ .. java:field:: public HttpResponseStatus status :outertype: HttpException Constructors ------------ HttpException ^^^^^^^^^^^^^ .. java:constructor:: public HttpException(HttpResponseStatus status, String message) :outertype: HttpException Initialize the Exception with appropriate status code and a message :param status: Status of the response. :param message: Message to be present in the response. **See also:** :java:ref:`HttpResponseStatus` Methods ------- conflict ^^^^^^^^ .. java:method:: public static HttpException conflict(String message) :outertype: HttpException Returns an Exception object that returns response with status "409 Conflict" and a custom message forbidden ^^^^^^^^^ .. java:method:: public static HttpException forbidden(String message) :outertype: HttpException Returns an Exception object that returns response with status "403 Forbidden" and a custom message internalServerError ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static HttpException internalServerError(String message) :outertype: HttpException Returns an Exception object that returns response with status "500 Internal Server Error" and a custom message notFound ^^^^^^^^ .. java:method:: public static HttpException notFound(String message) :outertype: HttpException Raise to return response with status "404 Not Found" and a custom message unAuthorized ^^^^^^^^^^^^ .. java:method:: public static HttpException unAuthorized(String message) :outertype: HttpException Returns an Exception object that returns response with status "404 Not Found" and a custom message