Wrap self.on_message in a try/except block

This commit is contained in:
Fabio Manganiello 2018-10-23 14:20:24 +00:00
parent 4c2302a534
commit 0a7722d858
1 changed files with 5 additions and 1 deletions

View File

@ -54,7 +54,11 @@ class Bus(object):
.format(int(time.time()-msg.timestamp), msg))
continue
self.on_message(msg)
try:
self.on_message(msg)
except Exception as e:
logger.error('Error on processing message {}'.format(msg))
logger.exception(e)
if isinstance(msg, StopEvent) and msg.targets_me():
logger.info('Received STOP event on the bus')