Description
In ExceptionUtils.convertFaultToResponse(), it only catches Exception. So CXF fails to process the request if we throw Error in our own XXXExceptionMapper. The definition of ExceptionMapper is:
Interface ExceptionMapper<E extends Throwable> So I think we should catch Throwable instead.
if (response == null) {
ExceptionMapper<T> mapper =
ServerProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
if (mapper != null) {
try
catch (Exception mapperEx)
{ inMessage.getExchange().put(JAXRSUtils.EXCEPTION_FROM_MAPPER, "true"); mapperEx.printStackTrace(); return Response.serverError().build(); }
}
}
}