Repository: cxf Updated Branches: refs/heads/3.0.x-fixes ca618c41b -> af303b6ee
[CXF-6842]:Unwrap exception nested with WebApplicationException Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4f027a0a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4f027a0a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4f027a0a Branch: refs/heads/3.0.x-fixes Commit: 4f027a0a9521674ef22e3f06dc91b1d49c50e8ee Parents: ca618c4 Author: Jim Ma <[email protected]> Authored: Fri Mar 25 13:02:35 2016 +0800 Committer: Jim Ma <[email protected]> Committed: Wed Mar 30 20:16:30 2016 +0800 ---------------------------------------------------------------------- .../main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/4f027a0a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java index 20977ee..ea24b37 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java @@ -95,6 +95,13 @@ public final class ExceptionUtils { } } } + if (response == null) { + Throwable unwrappedException = ex.getCause(); + if (unwrappedException instanceof WebApplicationException) { + WebApplicationException webEx = (WebApplicationException)unwrappedException; + return webEx.getResponse(); + } + } JAXRSUtils.setMessageContentType(currentMessage, response); return response; }
