cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1090037 - in /cxf/branches/2.3.x-fixes: ./ api/src/main/java/org/apache/cxf/message/Message.java rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
Date Thu, 07 Apr 2011 21:55:59 GMT
Author: dkulp
Date: Thu Apr  7 21:55:59 2011
New Revision: 1090037

URL: http://svn.apache.org/viewvc?rev=1090037&view=rev
Log:
Merged revisions 1089765 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1089765 | ningjiang | 2011-04-07 04:06:25 -0400 (Thu, 07 Apr 2011) | 1 line
  
  CXF-3442 add an option exceptionMessageCauseEnabled to generate the caused by message
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
    cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java?rev=1090037&r1=1090036&r2=1090037&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java Thu Apr
 7 21:55:59 2011
@@ -89,6 +89,7 @@ public interface Message extends StringM
     String MTOM_THRESHOLD = "mtom-threshold";
     String SCHEMA_VALIDATION_ENABLED = "schema-validation-enabled";
     String FAULT_STACKTRACE_ENABLED = "faultStackTraceEnabled";
+    String EXCEPTION_MESSAGE_CAUSE_ENABLED = "exceptionMessageCauseEnabled";
     String CONTENT_TYPE = "Content-Type";    
     String ACCEPT_CONTENT_TYPE = "Accept";
     String BASE_PATH = Message.class.getName() + ".BASE_PATH";

Modified: cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java?rev=1090037&r1=1090036&r2=1090037&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
Thu Apr  7 21:55:59 2011
@@ -97,7 +97,6 @@ public class FaultOutInterceptor extends
                         }
                     }
                 }
-    
                 f.setMessage(ex.getMessage());
             } catch (Exception fex) {
                 //ignore - if any exceptions occur here, we'll ignore them
@@ -105,6 +104,18 @@ public class FaultOutInterceptor extends
                 //the fault like it was an unchecked exception.
                 LOG.log(Level.WARNING, "EXCEPTION_WHILE_WRITING_FAULT", fex);
             }
+        } else {
+            // Cannot find the fault info, now we should check if we need to 
+            // set the cause message of the exception
+            String config = (String)message.getContextualProperty(
+                org.apache.cxf.message.Message.EXCEPTION_MESSAGE_CAUSE_ENABLED);
+            if (config != null && Boolean.valueOf(config).booleanValue()) {
+                StringBuffer buffer = new StringBuffer();
+                buffer.append(f.getMessage());
+                buffer.append(" Caused by: ");
+                buffer.append(cause.getMessage());
+                f.setMessage(buffer.toString());
+            }
         }
     }
 



Mime
View raw message