camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1201869 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/processor/interceptor/ camel-core/src/test/java/org/apache/camel/processor/interceptor/
Date Mon, 14 Nov 2011 20:18:02 GMT
Author: dkulp
Date: Mon Nov 14 20:18:02 2011
New Revision: 1201869

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

........
  r1198724 | davsclaus | 2011-11-07 08:25:21 -0500 (Mon, 07 Nov 2011) | 1 line
  
  CAMEL-4636: Caught exception is provided in the caused by exception field on trace event
message.
........

Added:
    camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageCausedByExceptionTest.java
      - copied unchanged from r1198724, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageCausedByExceptionTest.java
Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java?rev=1201869&r1=1201868&r2=1201869&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java
(original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java
Mon Nov 14 20:18:02 2011
@@ -80,12 +80,25 @@ public final class DefaultTraceEventMess
             this.outBody = MessageHelper.extractBodyAsString(out);
             this.outBodyType = MessageHelper.getBodyTypeName(out);
         }
-        this.causedByException = exchange.getException() != null ? exchange.getException().toString()
: null;
+        this.causedByException = extractCausedByException(exchange);
     }
 
     // Implementation
     //---------------------------------------------------------------
 
+    private static String extractCausedByException(Exchange exchange) {
+        Throwable cause = exchange.getException();
+        if (cause == null) {
+            cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
+        }
+
+        if (cause != null) {
+            return cause.toString();
+        } else {
+            return null;
+        }
+    }
+
     private static String extractShortExchangeId(Exchange exchange) {
         return exchange.getExchangeId().substring(exchange.getExchangeId().indexOf("/") +
1);
     }



Mime
View raw message