Commit 358acde8 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

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)


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac294@2692 e5f2f494-b856-4b98-b285-d166d9295462
parent 8773382c
......@@ -81,14 +81,14 @@ class ConfigManagerData:
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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment