Browse Source

Only set location in BuildException if the task didn't provide it

before.

This will give the correct location for errors in build files invoked
via the <ant> task.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268007 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
2aaf152da1
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/main/org/apache/tools/ant/Target.java

+ 4
- 1
src/main/org/apache/tools/ant/Target.java View File

@@ -144,7 +144,10 @@ public class Target {
} }
catch(RuntimeException exc) { catch(RuntimeException exc) {
if (exc instanceof BuildException) { if (exc instanceof BuildException) {
((BuildException)exc).setLocation(task.getLocation());
BuildException be = (BuildException) exc;
if (be.getLocation() == Location.UNKNOWN_LOCATION) {
be.setLocation(task.getLocation());
}
} }
project.fireTaskFinished(task, exc); project.fireTaskFinished(task, exc);
throw exc; throw exc;


Loading…
Cancel
Save