You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/07/01 11:37:06 UTC

cxf git commit: [CXF-6957] Passing Fault to exception mappers if the cause is null

Repository: cxf
Updated Branches:
  refs/heads/master 654f8ba90 -> d9851f827


[CXF-6957] Passing Fault to exception mappers if the cause is null


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d9851f82
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d9851f82
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d9851f82

Branch: refs/heads/master
Commit: d9851f827edcd10319265899372d32eb736303c9
Parents: 654f8ba
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Jul 1 12:31:27 2016 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Jul 1 12:31:27 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d9851f82/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
index ac445d9..32b6243 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
@@ -134,7 +134,7 @@ public class JAXRSInvoker extends AbstractInvoker {
         try {
             return handleFault(new Fault(t), exchange.getInMessage(), null, null);
         } catch (Fault ex) {
-            ar.setUnmappedThrowable(ex.getCause());
+            ar.setUnmappedThrowable(ex.getCause() == null ? ex : ex.getCause());
             if (isSuspended(exchange)) {
                 ar.reset();
                 exchange.getInMessage().getInterceptorChain().unpause();
@@ -197,7 +197,8 @@ public class JAXRSInvoker extends AbstractInvoker {
         } catch (Fault ex) {
             Object faultResponse;
             if (asyncResponse != null) {
-                faultResponse = handleAsyncFault(exchange, asyncResponse, ex.getCause());    
+                faultResponse = handleAsyncFault(exchange, asyncResponse, 
+                                                 ex.getCause() == null ? ex : ex.getCause());    
             } else {
                 faultResponse = handleFault(ex, inMessage, cri, methodToInvoke);
             }
@@ -326,7 +327,8 @@ public class JAXRSInvoker extends AbstractInvoker {
                                                        cri.getServiceClass().getName());
             LOG.severe(errorM.toString());
         }
-        Response excResponse = JAXRSUtils.convertFaultToResponse(ex.getCause(), inMessage);
+        Response excResponse = 
+            JAXRSUtils.convertFaultToResponse(ex.getCause() == null ? ex : ex.getCause(), inMessage);
         if (excResponse == null) {
             inMessage.getExchange().put(Message.PROPOGATE_EXCEPTION, 
                                         ExceptionUtils.propogateException(inMessage));