[portal-commits] JBoss Portal SVN: r8965 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Nov 15 21:50:11 EST 2007


Author: chris.laprun at jboss.com
Date: 2007-11-15 21:50:10 -0500 (Thu, 15 Nov 2007)
New Revision: 8965

Modified:
   branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
Log:
- Hmm, still need to create a detail even if the passed cause is null!

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java	2007-11-15 22:23:54 UTC (rev 8964)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPExceptionFactory.java	2007-11-16 02:50:10 UTC (rev 8965)
@@ -23,6 +23,7 @@
 
 package org.jboss.portal.wsrp;
 
+import org.jboss.logging.Logger;
 import org.jboss.portal.wsrp.servlet.ServletAccess;
 
 import javax.servlet.http.HttpServletRequest;
@@ -39,6 +40,7 @@
  */
 public class WSRPExceptionFactory
 {
+   private static Logger log = Logger.getLogger(WSRPExceptionFactory.class);
 
    private static final String NS = "urn:oasis:names:tc:wsrp:v1:types";
 
@@ -87,22 +89,6 @@
       Detail detail = null;
       if (cause != null)
       {
-         try
-         {
-            SOAPFactory soapFactory = SOAPFactory.newInstance();
-            detail = soapFactory.createDetail();
-
-            // using a DetailEntry with the proper errorCode and NS will cause JBossWS to create a user created exception
-            // for ex: errorCode == InvalidRegistration => InvalidRegistrationFault on the client side...
-            // however, due to the crappy nature of faults in WSRP, this is highly uninformative as all extra information
-            // is not propagated once the user exception is created :(
-            detail.addDetailEntry(soapFactory.createName(errorCode, NS_PREFIX, NS));
-         }
-         catch (SOAPException e)
-         {
-            e.printStackTrace();
-         }
-
          String causeMessage = cause.getLocalizedMessage();
          if (causeMessage != null)
          {
@@ -110,6 +96,22 @@
          }
       }
 
+      try
+      {
+         SOAPFactory soapFactory = SOAPFactory.newInstance();
+         detail = soapFactory.createDetail();
+
+         // using a DetailEntry with the proper errorCode and NS will cause JBossWS to create a user created exception
+         // for ex: errorCode == InvalidRegistration => InvalidRegistrationFault on the client side...
+         // however, due to the crappy nature of faults in WSRP, this is highly uninformative as all extra information
+         // is not propagated once the user exception is created :(
+         detail.addDetailEntry(soapFactory.createName(errorCode, NS_PREFIX, NS));
+      }
+      catch (SOAPException e)
+      {
+         log.debug("Couldn't create exception detail: ", e);
+      }
+
       String actor = null;
       HttpServletRequest req = ServletAccess.getRequest();
       if (req != null)




More information about the portal-commits mailing list