juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r934957 - /webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java
Date Fri, 16 Apr 2010 15:21:01 GMT
Author: tcunning
Date: Fri Apr 16 15:21:00 2010
New Revision: 934957

URL: http://svn.apache.org/viewvc?rev=934957&view=rev
Log:
JUDDI-385
Find the message from the very base exception and pass that on.    Also protect against sending
null to URLEncoder.encode to avoid NPE's.

Modified:
    webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java

Modified: webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java?rev=934957&r1=934956&r2=934957&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java
(original)
+++ webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/wrapper/RequestHandler.java
Fri Apr 16 15:21:00 2010
@@ -158,7 +158,19 @@ public class RequestHandler
       document.appendChild(element.getFirstChild());
       setResponse(document);
     } catch (InvocationTargetException ite) {
-    	String message = URLEncoder.encode(ite.getTargetException().getMessage());
+    	Throwable t = ite.getTargetException();
+    	String errorMessage = "";
+    	if (t.getCause() != null) {
+    		while (t.getCause() != null) {
+    			t = t.getCause();
+    		}
+    		errorMessage = t.getMessage() != null ?
+    				t.getMessage() : "";
+    	} else {
+    		errorMessage = ite.getTargetException().getMessage() != null ? 
+    				ite.getTargetException().getMessage() : "";
+    	}
+    	String message = URLEncoder.encode(errorMessage);
     	log.error(message);
     	setException(message);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org


Mime
View raw message