de.deepamehta.plugins.webservice.provider
Class CatchAllExceptionMapper

java.lang.Object
  extended by de.deepamehta.plugins.webservice.provider.CatchAllExceptionMapper
All Implemented Interfaces:
javax.ws.rs.ext.ExceptionMapper<Throwable>

@Provider
public class CatchAllExceptionMapper
extends Object
implements javax.ws.rs.ext.ExceptionMapper<Throwable>

Maps all Throwables but WebApplicationExceptions to a 500 (Internal Server Error) response. A WebApplicationException's response is returned directly.

We don't want Jersey to re-throw anything to the HTTP container as this would result in logging the exception twice and possibly to interspersed illegible stack traces (see #484).


Constructor Summary
CatchAllExceptionMapper()
           
 
Method Summary
 javax.ws.rs.core.Response toResponse(Throwable e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatchAllExceptionMapper

public CatchAllExceptionMapper()
Method Detail

toResponse

public javax.ws.rs.core.Response toResponse(Throwable e)
Specified by:
toResponse in interface javax.ws.rs.ext.ExceptionMapper<Throwable>


Copyright © 2015. All rights reserved.