Package google.registry.request
Class HttpException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- google.registry.request.HttpException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
HttpException.BadRequestException
,HttpException.ConflictException
,HttpException.ForbiddenException
,HttpException.InternalServerErrorException
,HttpException.MethodNotAllowedException
,HttpException.NoContentException
,HttpException.NotFoundException
,HttpException.NotImplementedException
,HttpException.NotModifiedException
,HttpException.ServiceUnavailableException
,HttpException.UnprocessableEntityException
,HttpException.UnsupportedMediaTypeException
public abstract class HttpException extends java.lang.RuntimeException
Base for exceptions that cause an HTTP error response.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpException.BadRequestException
Exception that causes a 400 response.static class
HttpException.ConflictException
Exception that causes a 409 response.static class
HttpException.ForbiddenException
Exception that causes a 403 response.static class
HttpException.InternalServerErrorException
Exception that causes a 500 response.static class
HttpException.MethodNotAllowedException
Exception that causes a 405 response.static class
HttpException.NoContentException
Exception that causes a 204 response.static class
HttpException.NotFoundException
Exception that causes a 404 response.static class
HttpException.NotImplementedException
Exception that causes a 501 response.static class
HttpException.NotModifiedException
Exception that causes a 304 response.static class
HttpException.ServiceUnavailableException
Exception that causes a 503 response.static class
HttpException.UnprocessableEntityException
Exception that causes a 422 response.static class
HttpException.UnsupportedMediaTypeException
Exception that causes a 415 response.
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpException(int responseCode, java.lang.String message, java.lang.Throwable cause)
protected
HttpException(int responseCode, java.lang.String message, java.lang.Throwable cause, java.util.logging.Level logLevel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getResponseCode()
java.lang.String
getResponseCodeString()
Returns the string associated with a particular response code.void
send(javax.servlet.http.HttpServletResponse rsp)
Transmits the error response to the client.
-
-
-
Method Detail
-
getResponseCode
public final int getResponseCode()
-
getResponseCodeString
public java.lang.String getResponseCodeString()
Returns the string associated with a particular response code. UnlikeThrowable.getMessage()
, which is meant to describe the circumstances under which this particular exception occurred, this method always returns the same string (e.g. "Not Found" for a 400 error), and so should always be the same for a given subclass ofHttpException
.
-
send
public final void send(javax.servlet.http.HttpServletResponse rsp) throws java.io.IOException
Transmits the error response to the client.Throwable.getMessage()
will be sent to the browser, whereasThrowable.toString()
andThrowable.getCause()
will be logged.- Throws:
java.io.IOException
-
-