org.odata4j.producer.resources
Class ExceptionMappingProvider

java.lang.Object
  extended by org.odata4j.producer.resources.ExceptionMappingProvider
All Implemented Interfaces:
ExceptionMapper<RuntimeException>

@Provider
public class ExceptionMappingProvider
extends Object
implements ExceptionMapper<RuntimeException>

Provider for correctly formatted server errors. Every RuntimeException that is not already an ODataProducerException is wrapped into a ServerErrorException (resulting in an HTTP Response.Status.INTERNAL_SERVER_ERROR).

See Also:
ErrorResponseExtension

Field Summary
protected  HttpHeaders httpHeaders
           
protected  ContextResolver<ODataProducer> producerResolver
           
protected  UriInfo uriInfo
           
 
Constructor Summary
ExceptionMappingProvider()
           
 
Method Summary
static ErrorResponse getErrorResponse(ODataProducerException exception, boolean includeInnerError)
           
 Response toResponse(RuntimeException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpHeaders

@Context
protected HttpHeaders httpHeaders

producerResolver

@Context
protected ContextResolver<ODataProducer> producerResolver

uriInfo

@Context
protected UriInfo uriInfo
Constructor Detail

ExceptionMappingProvider

public ExceptionMappingProvider()
Method Detail

getErrorResponse

public static ErrorResponse getErrorResponse(ODataProducerException exception,
                                             boolean includeInnerError)

toResponse

public Response toResponse(RuntimeException e)
Specified by:
toResponse in interface ExceptionMapper<RuntimeException>


http://odata4j.org