Browse Source

improve Ant's error message if encoding decl of build file is invalid.

PR: 7825


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272317 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
6270426641
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java

+ 6
- 1
src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java View File

@@ -58,6 +58,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Locale;
import org.xml.sax.Locator;
import org.xml.sax.InputSource;
@@ -187,8 +188,12 @@ public class ProjectHelperImpl extends ProjectHelper {
throw new BuildException(exc.getMessage(), t);
} catch (FileNotFoundException exc) {
throw new BuildException(exc);
} catch (UnsupportedEncodingException exc) {
throw new BuildException("Encoding of project file is invalid.",
exc);
} catch (IOException exc) {
throw new BuildException("Error reading project file", exc);
throw new BuildException("Error reading project file: "
+exc.getMessage(), exc);
} finally {
if (inputStream != null) {
try {


Loading…
Cancel
Save