Browse Source

BuildExceptions get caught and rethrown

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@531599 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
450a402c32
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java

+ 4
- 0
src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java View File

@@ -95,7 +95,11 @@ public class JavaxScriptRunner extends ScriptRunnerBase {
}
// execute the script
return engine.invoke("eval", String.class, getScript());
} catch (BuildException be) {
//catch and rethrow build exceptions
throw be;
} catch (Exception be) {
//any other exception? Get its cause
Throwable t = be;
Throwable te = (Throwable) ReflectUtil.invoke(be, "getCause");
if (te != null) {


Loading…
Cancel
Save