servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1576230 - /servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
Date Tue, 11 Mar 2014 08:37:55 GMT
Author: ffang
Date: Tue Mar 11 08:37:54 2014
New Revision: 1576230

URL: http://svn.apache.org/r1576230
Log:
[SMX4-1719]NMRDestination would miss return exception in OutInterceptorChain in some cases

Modified:
    servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java

Modified: servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java?rev=1576230&r1=1576229&r2=1576230&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
(original)
+++ servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
Tue Mar 11 08:37:54 2014
@@ -78,9 +78,25 @@ public class NMRDestinationOutputStream 
                 return;
             } else {
                 InputStream bais = getInputStream();
+                Exchange xchng = inMessage.get(Exchange.class);
+                if (inMessage.getExchange().getOutFaultMessage() != null
+                    && inMessage.getExchange().getOutFaultMessage().getContent(Exception.class)
!= null) {
+                    //check if there is an OutFaultMessage and Exception here first and return
the Error fast
+                    Exception ex = inMessage.getExchange().getOutFaultMessage().getContent(Exception.class);
+                    if (ex instanceof org.apache.cxf.interceptor.Fault) {
+                        org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault)ex;
+                        if (!f.hasDetails()) {
+                            xchng.setError(f);
+                        }
+                    } else {
+                        xchng.setError(ex);
+                    }
+                    channel.send(xchng);
+                    return;
+                }
+
                 StreamSource ss = new StreamSource(bais);
                            
-                Exchange xchng = inMessage.get(Exchange.class);
                 LOG.fine(new org.apache.cxf.common.i18n.Message("CREATE.NORMALIZED.MESSAGE",
LOG).toString());
                 if (inMessage.getExchange().getOutFaultMessage() != null) {
                     Exception ex = inMessage.getContent(Exception.class);



Mime
View raw message