[svn] commit: r2692 - /branches/trac294/src/lib/python/isc/config/cfgmgr.py

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Aug 10 18:58:14 UTC 2010


Author: jelte
Date: Tue Aug 10 18:58:14 2010
New Revision: 2692

Log:
used text suggested in http://bind10.isc.org/ticket/294#comment:12 for errors
also made the catch-all only catch the ValueError from json (so it does not catch our own exceptions)

Modified:
    branches/trac294/src/lib/python/isc/config/cfgmgr.py

Modified: branches/trac294/src/lib/python/isc/config/cfgmgr.py
==============================================================================
--- branches/trac294/src/lib/python/isc/config/cfgmgr.py (original)
+++ branches/trac294/src/lib/python/isc/config/cfgmgr.py Tue Aug 10 18:58:14 2010
@@ -81,14 +81,14 @@
                     config.data = file_config
                 else:
                     if config_data.BIND10_CONFIG_DATA_VERSION > file_config['version']:
-                        raise ConfigManagerDataReadError("Version of config data too old")
+                        raise ConfigManagerDataReadError("Cannot load configuration file: version %d no longer supported" % file_config['version'])
                     else:
-                        raise ConfigManagerDataReadError("Version of config data too new")
+                        raise ConfigManagerDataReadError("Cannot load configuration file: version %d not yet supported" % file_config['version'])
             else:
                 raise ConfigManagerDataReadError("No version information in configuration file " + config.db_filename)
         except IOError as ioe:
-            raise ConfigManagerDataEmpty("No config file found")
-        except:
+            raise ConfigManagerDataEmpty("No configuration file found")
+        except ValueError:
             raise ConfigManagerDataReadError("Config file out of date or corrupt, please update or remove " + config.db_filename)
         finally:
             if file:




More information about the bind10-changes mailing list