Repository: cxf Updated Branches: refs/heads/master 66447a377 -> 0566a4ea0
[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/0566a4ea Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0566a4ea Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0566a4ea Branch: refs/heads/master Commit: 0566a4ea07c8cb9ad819890507519cc120edb5ad Parents: 66447a3 Author: Jim Ma <[email protected]> Authored: Fri Mar 25 13:02:35 2016 +0800 Committer: Jim Ma <[email protected]> Committed: Fri Mar 25 13:02:35 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/0566a4ea/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 5e9c257..71cad74 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 @@ -91,6 +91,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; }
