iris ding created CXF-5943:
------------------------------
Summary: Throw error in exceptionmapper
Key: CXF-5943
URL: https://issues.apache.org/jira/browse/CXF-5943
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 3.0.0
Reporter: iris ding
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 {
response = mapper.toResponse(ex);
} catch (Exception mapperEx) {
inMessage.getExchange().put(JAXRSUtils.EXCEPTION_FROM_MAPPER, "true");
mapperEx.printStackTrace();
return Response.serverError().build();
}
}
}
}
--
This message was sent by Atlassian JIRA
(v6.2#6252)