You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/06/03 10:37:04 UTC

[2/2] git commit: CAMEL-6416 fixed the NPE when some scripting exceptions don't have cause

CAMEL-6416 fixed the NPE when some scripting exceptions don't have cause


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

Branch: refs/heads/master
Commit: 08d00707c25c255f9ba0013ea90608999fdc4460
Parents: 7a3dc78
Author: Willem Jiang <ni...@apache.org>
Authored: Mon Jun 3 16:35:32 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Mon Jun 3 16:36:20 2013 +0800

----------------------------------------------------------------------
 .../apache/camel/builder/script/ScriptBuilder.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/08d00707/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
----------------------------------------------------------------------
diff --git a/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java b/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
index 72ed963..9feca5e 100644
--- a/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
+++ b/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
@@ -344,8 +344,12 @@ public class ScriptBuilder implements Expression, Predicate, Processor {
         } catch (ScriptException e) {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Script evaluation failed: " + e.getMessage(), e);
+            } 
+            if (e.getCause()!= null) {
+                throw createScriptEvaluationException(e.getCause());
+            } else {
+                throw createScriptEvaluationException(e);
             }
-            throw createScriptEvaluationException(e.getCause());
         } catch (IOException e) {
             throw createScriptEvaluationException(e);
         }