de.deepamehta.plugins.webservice.provider
Class CatchAllExceptionMapper

Show UML class diagram
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).


Nested Class Summary
private static class CatchAllExceptionMapper.ExceptionInfo
           
 
Field Summary
private  Logger logger
           
(package private)  javax.servlet.http.HttpServletRequest request
           
 
Constructor Summary
CatchAllExceptionMapper()
           
 
Method Summary
private  String errorMessage(javax.ws.rs.core.Response.Status status)
           
private  boolean hasNestedAccessControlException(Throwable e)
           
 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
 

Field Detail

request

@Context
javax.servlet.http.HttpServletRequest request

logger

private Logger logger
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>

hasNestedAccessControlException

private boolean hasNestedAccessControlException(Throwable e)

errorMessage

private String errorMessage(javax.ws.rs.core.Response.Status status)


Copyright © 2015. All Rights Reserved.