From e4181e32abc86dc14974df6cf04bd5911e0b117c Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 23 Jun 2000 14:17:17 +0000 Subject: [PATCH] Improved error messages if srcdir doesn't exist. Submitted by: Peter Nordlund git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267687 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Copydir.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Copydir.java b/src/main/org/apache/tools/ant/taskdefs/Copydir.java index afac0b8a3..aee14ccf5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copydir.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copydir.java @@ -86,11 +86,13 @@ public class Copydir extends MatchingTask { public void execute() throws BuildException { if (srcDir == null) { - throw new BuildException("srcdir attribute must be set!"); + throw new BuildException("srcdir attribute must be set!", + location); } if (!srcDir.exists()) { - throw new BuildException("srcdir does not exist!"); + throw new BuildException("srcdir "+srcDir.toString() + +" does not exist!", location); } DirectoryScanner ds = super.getDirectoryScanner(srcDir); @@ -109,7 +111,7 @@ public class Copydir extends MatchingTask { } catch (IOException ioe) { String msg = "Failed to copy " + fromFile + " to " + toFile + " due to " + ioe.getMessage(); - throw new BuildException(msg); + throw new BuildException(msg, ioe, location); } } }