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:
parent
54f1386357
commit
392c13c9d8
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue