cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r880992 - in /cxf/trunk: rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
Date Mon, 16 Nov 2009 22:04:08 GMT
Author: dkulp
Date: Mon Nov 16 22:04:07 2009
New Revision: 880992

URL: http://svn.apache.org/viewvc?rev=880992&view=rev
Log:
[CXF-2537] Even better error message

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=880992&r1=880991&r2=880992&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Mon Nov 16 22:04:07 2009
@@ -1981,12 +1981,19 @@
             try {
                 handleResponse();
             } catch (IOException e) {
+                String url = connection.getURL().toString();
+                String origMessage = e.getMessage();
+                if (origMessage != null && origMessage.contains(url)) {
+                    throw e;
+                }
                 throw mapException(e.getClass().getSimpleName() 
-                                   + " invoking " + connection.getURL(), e,
+                                   + " invoking " + connection.getURL() + ": "
+                                   + e.getMessage(), e,
                                    IOException.class);
             } catch (RuntimeException e) {
                 throw mapException(e.getClass().getSimpleName() 
-                                   + " invoking " + connection.getURL(), e,
+                                   + " invoking " + connection.getURL() + ": "
+                                   + e.getMessage(), e,
                                    RuntimeException.class);
             } finally {
                 if (cachingForRetransmission && cachedStream != null) {
@@ -1994,7 +2001,8 @@
                 }
             }
         }
-        private <T extends Exception> T mapException(String msg, T ex, Class<T>
cls) {
+        private <T extends Exception> T mapException(String msg, 
+                                                     T ex, Class<T> cls) {
             T ex2 = ex;
             try {
                 ex2 = cls.cast(ex.getClass().getConstructor(String.class).newInstance(msg));

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java?rev=880992&r1=880991&r2=880992&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
Mon Nov 16 22:04:07 2009
@@ -149,7 +149,7 @@
             greeter.greetMe("cxf");
             fail("Didn't get the exception");
         } catch (Exception ex) {
-            ex.printStackTrace();
+            //ex.printStackTrace();
             assertTrue(ex.getCause().getClass().getName(), ex.getCause() instanceof SocketTimeoutException);
         }
      



Mime
View raw message