From b39b205cf3e1da8ec2769d2b4c23e7bc823c9a06 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 20 Jun 2020 17:30:38 +0200 Subject: [PATCH] some resilience and logging output --- distbot/bot/worker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/distbot/bot/worker.py b/distbot/bot/worker.py index 04aa8ae..2a86701 100644 --- a/distbot/bot/worker.py +++ b/distbot/bot/worker.py @@ -60,7 +60,12 @@ class Worker(threading.Thread): def callback(self, ch, method, properties, body): logger.debug("Reacting on %s in %s", str(method.routing_key), self.get_subclass_name()) body = json.loads(body.decode("utf-8")) - self.used_channel = method.routing_key.split(".") + try: + self.used_channel = method.routing_key.split(".") + except TypeError as e: + logging.error(f"{str(method.routing_key)} is of type {type(method.routing_key)}") + logging.exception(e) + self.used_channel = ["__error__"] if self.uses_history: self.history = self.total_history[body["to"]] -- 2.39.2