cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1187390 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
Date Fri, 21 Oct 2011 15:13:43 GMT
Author: sergeyb
Date: Fri Oct 21 15:13:43 2011
New Revision: 1187390

URL: http://svn.apache.org/viewvc?rev=1187390&view=rev
Log:
[CXF-3872] Better exception reporting, patch on behalf of Andrei Shakirin - thanks

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java?rev=1187390&r1=1187389&r2=1187390&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
Fri Oct 21 15:13:43 2011
@@ -22,6 +22,7 @@ package org.apache.cxf.binding.soap.saaj
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.net.ConnectException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.ResourceBundle;
@@ -211,8 +212,13 @@ public class SAAJOutInterceptor extends 
                         message.setContent(XMLStreamWriter.class, writer);
                     }
                 } catch (XMLStreamException e) {
-                    throw new SoapFault(new Message("SOAPEXCEPTION", BUNDLE), e, message.getVersion()
-                                        .getSender());
+                    if (e.getCause() instanceof ConnectException) {
+                        throw new SoapFault(e.getCause().getMessage(), e,
+                                            message.getVersion().getSender());
+                    } else {
+                        throw new SoapFault(new Message("SOAPEXCEPTION", BUNDLE), e,
+                                            message.getVersion().getSender());
+                    }
                 }
             }
         }



Mime
View raw message