camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] git commit: CAMEL-7768: Handle fault - Should convert the payload to String using type converter
Date Sat, 30 Aug 2014 13:03:10 GMT
CAMEL-7768: Handle fault - Should convert the payload to String using type converter


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f3309eb2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f3309eb2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f3309eb2

Branch: refs/heads/master
Commit: f3309eb2b368115f3b95420ea31f00df40a5307e
Parents: 09cbacb
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Aug 30 09:58:46 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Aug 30 09:58:46 2014 +0200

----------------------------------------------------------------------
 .../camel/processor/interceptor/HandleFaultInterceptor.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f3309eb2/camel-core/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
b/camel-core/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
index cc6bbe5..538fe88 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
@@ -65,7 +65,8 @@ public class HandleFaultInterceptor extends DelegateAsyncProcessor {
                     exchange.setException((Throwable) faultBody);
                 } else {
                     // wrap it in an exception
-                    exchange.setException(new CamelException(faultBody.toString()));
+                    String data = exchange.getContext().getTypeConverter().convertTo(String.class,
exchange, faultBody);
+                    exchange.setException(new CamelException(data));
                 }
             }
         }


Mime
View raw message