Browse Source

Make sure a BuildException thrown inside a <script> doesn't get

wrapped into yet another BuildException.

Submitted by:	Nico Seessle <nico@seessle.de>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268078 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
3c045b38b0
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/Script.java

+ 9
- 3
src/main/org/apache/tools/ant/taskdefs/optional/Script.java View File

@@ -109,10 +109,16 @@ public class Script extends Task {
// execute the script
manager.exec(language, "<ANT>", 0, 0, script);
} catch (BSFException be) {
Exception e = be;
Throwable t = be;
Throwable te = be.getTargetException();
if (te != null && te instanceof Exception) e = (Exception) te;
throw new BuildException(e);
if (te != null) {
if (te instanceof BuildException) {
throw (BuildException) te;
} else {
t = te;
}
}
throw new BuildException(t);
}
}



Loading…
Cancel
Save