From b905f0902c3d8063ca268eab358e6248e9d52012 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 8 Nov 2002 14:59:46 +0000 Subject: [PATCH] Improve error reporting in PR: 14061 Submitted by: Jesse Glick git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273520 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/FixCRLF.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java index 4b66dcf25..6815078c8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java +++ b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java @@ -806,15 +806,18 @@ public class FixCRLF extends MatchingTask { private BufferedReader reader; private StringBuffer line = new StringBuffer(); private boolean reachedEof = false; + private File srcFile; public OneLiner(File srcFile) throws BuildException { + this.srcFile = srcFile; try { reader = new BufferedReader (getReader(srcFile), INBUFLEN); nextLine(); } catch (IOException e) { - throw new BuildException(e); + throw new BuildException(srcFile + ": "+ e.getMessage(), + e, getLocation()); } } @@ -898,7 +901,8 @@ public class FixCRLF extends MatchingTask { } // end of if (eolcount == 0) } catch (IOException e) { - throw new BuildException(e); + throw new BuildException(srcFile + ": "+ e.getMessage(), + e, getLocation()); } }