commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration AbstractFileConfiguration.java
Date Wed, 22 Sep 2004 17:29:08 GMT
ebourg      2004/09/22 10:29:08

  Modified:    configuration/src/java/org/apache/commons/configuration
                        AbstractFileConfiguration.java
  Log:
  Catch all exceptions on loading and throw a ConfigurationException
  
  Revision  Changes    Path
  1.2       +14 -3     jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java
  
  Index: AbstractFileConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractFileConfiguration.java	22 Sep 2004 17:17:30 -0000	1.1
  +++ AbstractFileConfiguration.java	22 Sep 2004 17:29:08 -0000	1.2
  @@ -75,8 +75,19 @@
        */
       public void load(String fileName) throws ConfigurationException
       {
  -        URL url = ConfigurationUtils.locate(basePath, fileName);
  -        load(url);
  +        try
  +        {
  +            URL url = ConfigurationUtils.locate(basePath, fileName);
  +            load(url);
  +        }
  +        catch (ConfigurationException e)
  +        {
  +            throw e;
  +        }
  +        catch (Exception e)
  +        {
  +            throw new ConfigurationException(e.getMessage(), e);
  +        }
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message