From 62704266416edfa102e7c8f7f91fef0553fdd8f1 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 9 Apr 2002 14:43:30 +0000 Subject: [PATCH] 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 --- .../org/apache/tools/ant/helper/ProjectHelperImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java index 11bc0bf07..eceed8d06 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java @@ -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 {