From b3133035a4fa0e086dfb0dfbefbc7f1540521bbc Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Tue, 2 Jul 2002 11:51:56 +0000 Subject: [PATCH] 576165: better error handling for missing properties file. --- build.xml | 9 +++++++++ docs/releasenotes.html | 2 +- .../com/puppycrawl/tools/checkstyle/CheckStyleTask.java | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index cb5c836ce..4a263eb09 100644 --- a/build.xml +++ b/build.xml @@ -208,6 +208,15 @@ + + + + + + + + diff --git a/docs/releasenotes.html b/docs/releasenotes.html index 7bbfdc535..1289cf0ea 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -61,7 +61,7 @@

Resolved bugs:

    -
  • Bugs! What bugs?
  • +
  • Better error reporting for missing properties files (bug 576165).

diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java index 6737724c3..7bb8b92b6 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java @@ -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); } }