From: Thorsten Date: Sat, 20 Jun 2020 15:30:38 +0000 (+0200) Subject: some resilience and logging output X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=b39b205cf3e1da8ec2769d2b4c23e7bc823c9a06;p=urlbot-v3.git some resilience and logging output --- 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"]]