576165: better error handling for missing properties file.

This commit is contained in:
Oliver Burn 2002-07-02 11:51:56 +00:00
parent bbe51f6884
commit b3133035a4
3 changed files with 16 additions and 2 deletions

View File

@ -208,6 +208,15 @@
<checkstyle/>
</target>
<target name="checkstyle.another" depends="compile.checkstyle">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="run.classpath"/>
</taskdef>
<echo message="Calling checkstyle with missing properties file" />
<checkstyle properties="xzzaaqqwet3ad"/>
</target>
<target name="checkstyle.style" depends="compile.checkstyle">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">

View File

@ -61,7 +61,7 @@
<p class="body">
Resolved bugs:
<ul>
<li class="body">Bugs! What bugs?</li>
<li class="body">Better error reporting for missing properties files (bug 576165).</li>
</ul>
</p>

View File

@ -19,6 +19,7 @@
package com.puppycrawl.tools.checkstyle;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@ -157,9 +158,13 @@ public class CheckStyleTask
mProperties.load(new FileInputStream(aProps));
mConfig = new Configuration(mProperties, System.out);
}
catch (FileNotFoundException e) {
throw new BuildException(
"Could not find Properties file '" + aProps + "'", e, location);
}
catch (Exception e) {
throw new BuildException(
"Could not find Properties file '" + aProps + "'", location);
"Error loading Properties file '" + aProps + "'", e, location);
}
}