Add a message to AttributeError in config.py

If you happen to try to use a non-existing config
variable inside a try-catch where you catch
Exception and then log its message, the resulting
error message isn't going to be very helpful when
the caught Exception itself has no message.

This adds a simple message to the AttributeError
which is raised by config.py if a non-existing
config variable is attempted to be used.
This commit is contained in:
Ville-Pekka Vainio 2009-01-05 13:37:32 +01:00 committed by Thomas Perl
parent 54f1386357
commit 392c13c9d8

View file

@ -179,7 +179,7 @@ class Config(dict):
( fieldtype, default ) = self.Settings[name]
return self[name]
else:
raise AttributeError
raise AttributeError('%s is not a setting' % name)
def add_observer(self, callback):
"""