mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 07:07:58 +00:00
Fix handling exceptions
This commit is contained in:
@@ -186,12 +186,15 @@ class TaskManager(object):
|
||||
task.func(*task.args, interrupter=self._task_interrupt_event, **task.kwargs)
|
||||
|
||||
except Exception as e:
|
||||
try:
|
||||
logger.error("Error '{}' occurred in task {}".format(e, task))
|
||||
#print("Error '{}' occurred in task {}".format(e, task))
|
||||
if str(e) == 'STOP':
|
||||
self.reset()
|
||||
logger.error("Return after STOP exception, can't arm!")
|
||||
return
|
||||
except (KeyError, TypeError):
|
||||
logger.error(e)
|
||||
else:
|
||||
logger.error("Task interrupted before execution")
|
||||
#print("Task interrupted before execution")
|
||||
|
||||
@@ -157,7 +157,11 @@ class ConfigManager:
|
||||
keys = self.__dict__['_name_dict'][item]
|
||||
return self.get_chain(*keys)
|
||||
except (ValueError, KeyError):
|
||||
try:
|
||||
return self.__dict__[item]
|
||||
except KeyError:
|
||||
print("config: KeyError with item {}".format(item))
|
||||
return None
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user