Browse Source

Better error reporting when users set the wrong default namespace.

PR: 30660
Submitted by:	Kevin Greiner <kgreiner at xpediantsolutions dot com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276963 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
39404a0194
2 changed files with 12 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +11
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java

+ 1
- 0
CONTRIBUTORS View File

@@ -104,6 +104,7 @@ Josh Lucas
Juerg Wanner
Keiron Liddle
Keith Visco
Kevin Greiner
Kevin Ross
Kevin Z Grey
Kirk Wylie


+ 11
- 1
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -220,6 +220,8 @@ public class ProjectHelper2 extends ProjectHelper {
be.setLocation(location);
}
throw be;
} else if (t == null) {
t = exc;
}

throw new BuildException(exc.getMessage(), t, location);
@@ -227,6 +229,8 @@ public class ProjectHelper2 extends ProjectHelper {
Throwable t = exc.getException();
if (t instanceof BuildException) {
throw (BuildException) t;
} else if (t == null) {
t = exc;
}
throw new BuildException(exc.getMessage(), t);
} catch (FileNotFoundException exc) {
@@ -552,8 +556,14 @@ public class ProjectHelper2 extends ProjectHelper {
// if (qname.equals( "target" ) )
// return ProjectHelper2.targetHandler;
// }
throw new SAXParseException("Unexpected element \"" + qname
if (name.equals(qname)) {
throw new SAXParseException("Unexpected element \"{" + uri
+ "}" + name + "\" {" + ANT_CORE_URI + "}" + name,
context.getLocator());
} else {
throw new SAXParseException("Unexpected element \"" + qname
+ "\" " + name, context.getLocator());
}
}
}
}


Loading…
Cancel
Save