Package org.infinispan.rest
Class RestResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.infinispan.rest.RestResponseException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthenticationException
,MalformedRequest
,NoCacheFoundException
,NoDataFoundException
,NoKeyException
,NoMediaTypeException
,PreconditionsFailedException
,ServerInternalException
,ServiceUnavailableException
,UnacceptableDataFormatException
,WrongContextException
,WrongDateFormatException
public class RestResponseException extends RuntimeException
An exception representing non-critical HTTP processing errors which will be translated intoInfinispanResponse
and sent back to the client.Http20RequestHandler
andHttp11RequestHandler
are responsible for catching subtypes of this exception and translate them into proper Netty responses.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RestResponseException(io.netty.handler.codec.http.HttpResponseStatus status, String text)
Creates newRestResponseException
.RestResponseException(io.netty.handler.codec.http.HttpResponseStatus status, String text, Throwable t)
Creates newRestResponseException
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfinispanResponse
toResponse(InfinispanRequest request)
Creates Netty response based on error.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RestResponseException
public RestResponseException(io.netty.handler.codec.http.HttpResponseStatus status, String text)
Creates newRestResponseException
.- Parameters:
status
- Status code returned to the client.text
- Text returned to the client.
-
RestResponseException
public RestResponseException(io.netty.handler.codec.http.HttpResponseStatus status, String text, Throwable t)
Creates newRestResponseException
.- Parameters:
status
- Status code returned to the client.text
- Text returned to the client.t
- Throwable instance.
-
-
Method Detail
-
toResponse
public InfinispanResponse toResponse(InfinispanRequest request)
Creates Netty response based on error.- Parameters:
request
-- Returns:
- Netty response.
-
-