cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/3] cxf git commit: [CXF-6842]:Unwrap exception nested with WebApplicationException
Date Wed, 30 Mar 2016 12:14:09 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes e7e710685 -> 659084236


[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/b133237f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b133237f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b133237f

Branch: refs/heads/3.1.x-fixes
Commit: b133237f0f092351b9fcdba4019ab64d77d0111b
Parents: e7e7106
Author: Jim Ma <ema@apache.org>
Authored: Fri Mar 25 13:02:35 2016 +0800
Committer: Jim Ma <ema@apache.org>
Committed: Wed Mar 30 19:57:14 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/b133237f/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;
     }


Mime
View raw message