Package org.eclipse.jetty.http
Interface HttpException
- All Superinterfaces:
QuietException
- All Known Implementing Classes:
BadMessageException,HttpException.IllegalArgumentException,HttpException.IllegalStateException,HttpException.RuntimeException
A tagging interface for Exceptions that carry an HTTP response code and reason.
Exception subclasses that implement this interface will be caught by the container
and the getCode() used to send a response.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn IllegalArgumentException version of HttpException.static classAn IllegalStateException version of HttpException.static classA RuntimeException version of HttpException.Nested classes/interfaces inherited from interface org.eclipse.jetty.io.QuietException
QuietException.Exception -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpExceptionasHttpException(Throwable throwable) intgetCode()static voidthrowAsUnchecked(HttpException httpException) Throw the given HttpException as an unchecked exception.static voidthrowAsUncheckedHttpException(Throwable throwable) Convert the given Throwable to an HttpException and throw it as an unchecked exception.static voidIf the given Throwable is an HttpException, throw it as an unchecked exception.
-
Method Details
-
getCode
int getCode() -
getReason
String getReason() -
asHttpException
-
throwAsUnchecked
Throw the given HttpException as an unchecked exception.- Parameters:
httpException- the HttpException to throw
-
throwAsUncheckedHttpException
Convert the given Throwable to an HttpException and throw it as an unchecked exception.- Parameters:
throwable- the Throwable to convert and throw
-
throwIfHttpException
If the given Throwable is an HttpException, throw it as an unchecked exception.- Parameters:
th- the Throwable to check and possibly throw
-