Browse Source

Improve error messages when creating tasks

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274659 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
f97fcdb35e
2 changed files with 5 additions and 1 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/ComponentHelper.java
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Definer.java

+ 4
- 0
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -465,6 +465,10 @@ public class ComponentHelper {
String msg = " +Task: " + taskType;
project.log (msg, Project.MSG_DEBUG);
return task;
} catch (NoClassDefFoundError ncdfe) {
String msg = "Task " + taskType + ": A class needed by class "
+ c + " cannot be found: " + ncdfe.getMessage();
throw new BuildException(msg, ncdfe);
} catch (Throwable t) {
System.out.println("task CL=" + c.getClassLoader());
String msg = "Could not create task of type: "


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -250,7 +250,7 @@ public abstract class Definer extends Task {
+ " cannot be found";
throw new BuildException(msg, cnfe, getLocation());
} catch (NoClassDefFoundError ncdfe) {
String msg = getTaskName() + "A class needed on loading by class "
String msg = getTaskName() + ": A class needed by class "
+ value + " cannot be found: " + ncdfe.getMessage();
throw new BuildException(msg, ncdfe, location);
}


Loading…
Cancel
Save