From 4ec8012f430c57460a1f91c85db450f7e04d0f02 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 26 Jun 2000 10:47:36 +0000 Subject: [PATCH] Propagate a caught Exception inside the thrown BuildException. Suggested by: Julien Couvreur Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267702 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Exec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Exec.java b/src/main/org/apache/tools/ant/taskdefs/Exec.java index 6bbcfc2d9..c0fef65fa 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Exec.java +++ b/src/main/org/apache/tools/ant/taskdefs/Exec.java @@ -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;