You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2008/04/06 15:39:55 UTC
svn commit: r645241 - in
/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration:
AbstractFileConfiguration.java INIConfiguration.java XMLConfiguration.java
Author: ebourg
Date: Sun Apr 6 06:39:53 2008
New Revision: 645241
URL: http://svn.apache.org/viewvc?rev=645241&view=rev
Log:
Added meaningful messages when rethrowing exceptions
Modified:
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/INIConfiguration.java
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java?rev=645241&r1=645240&r2=645241&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java Sun Apr 6 06:39:53 2008
@@ -222,7 +222,7 @@
}
catch (Exception e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to load the configuration file " + fileName, e);
}
}
@@ -246,7 +246,7 @@
}
catch (Exception e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to load the configuration file " + file, e);
}
}
@@ -290,7 +290,7 @@
}
catch (Exception e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to load the configuration from the URL " + url, e);
}
finally
{
@@ -406,7 +406,7 @@
}
catch (Exception e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to save the configuration to the file " + fileName, e);
}
}
@@ -490,7 +490,7 @@
}
catch (IOException e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to save the configuration to the file " + file, e);
}
finally
{
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/INIConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/INIConfiguration.java?rev=645241&r1=645240&r2=645241&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/INIConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/INIConfiguration.java Sun Apr 6 06:39:53 2008
@@ -326,9 +326,9 @@
line = bufferedReader.readLine();
}
}
- catch (IOException ioe)
+ catch (IOException e)
{
- throw new ConfigurationException(ioe.getMessage());
+ throw new ConfigurationException("Unable to load the configuration", e);
}
}
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java?rev=645241&r1=645240&r2=645241&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java Sun Apr 6 06:39:53 2008
@@ -725,7 +725,7 @@
}
catch (Exception e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to load the configuration", e);
}
}
@@ -746,11 +746,11 @@
}
catch (TransformerException e)
{
- throw new ConfigurationException(e.getMessage(), e);
+ throw new ConfigurationException("Unable to save the configuration", e);
}
- catch (TransformerFactoryConfigurationError err)
+ catch (TransformerFactoryConfigurationError e)
{
- throw new ConfigurationException(err.getMessage(), err);
+ throw new ConfigurationException("Unable to save the configuration", e);
}
}