From 0a7722d8584cfb605f9e651116e6660afe4c315f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 23 Oct 2018 14:20:24 +0000 Subject: [PATCH] Wrap self.on_message in a try/except block --- platypush/bus/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/bus/__init__.py b/platypush/bus/__init__.py index 7a461c6b20..501e1d55f4 100644 --- a/platypush/bus/__init__.py +++ b/platypush/bus/__init__.py @@ -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')