Browse Source

Propagate a caught Exception inside the thrown BuildException.

Suggested by:	Julien Couvreur <jcouvreur@redcart.com>
Reviewed by:


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

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -97,7 +97,7 @@ public class Exec extends Task {
command = "cmd /c cd " + dir + " && " + command;
} else {
String ant = project.getProperty("ant.home");
if (ant == null) throw new BuildException("Property 'ant.home' not found");
if (ant == null) throw new BuildException("Property 'ant.home' not found", location);
String antRun = project.resolveFile(ant + "/bin/antRun").toString();

command = antRun + " " + dir + " " + command;
@@ -141,7 +141,7 @@ public class Exec extends Task {
project.log("Result: " + err, "exec", Project.MSG_ERR);
}
} catch (IOException ioe) {
throw new BuildException("Error exec: " + command );
throw new BuildException("Error exec: " + command, ioe, location);
} catch (InterruptedException ex) {}

return err;


Loading…
Cancel
Save