camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/2] git commit: CAMEL-6416 fixed the NPE when some scripting exceptions don't have cause
Date Mon, 03 Jun 2013 08:37:04 GMT
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 <ningjiang@apache.org>
Authored: Mon Jun 3 16:35:32 2013 +0800
Committer: Willem Jiang <ningjiang@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);
         }


Mime
View raw message