When processing exception from _load do not allow overwriting it

If `self.loaded.pop` raises KeyError then this KeyError will be logged, not the 
initial exception from `self._load`.
This commit is contained in:
ZyX 2014-08-23 19:09:28 +04:00
parent f6f8dd8af3
commit 483b261019
1 changed files with 1 additions and 1 deletions

View File

@ -195,11 +195,11 @@ class ConfigLoader(MultiRunnedThread):
try: try:
self.loaded[path] = deepcopy(self._load(path)) self.loaded[path] = deepcopy(self._load(path))
except Exception as e: except Exception as e:
self.exception('Error while loading {0}: {1}', path, str(e))
try: try:
self.loaded.pop(path) self.loaded.pop(path)
except KeyError: except KeyError:
pass pass
self.exception('Error while loading {0}: {1}', path, str(e))
try: try:
self.loaded.pop(path) self.loaded.pop(path)
except KeyError: except KeyError: