]> git.aero2k.de Git - urlbot-v3.git/commitdiff
some lib-/platform related scenario lets the bot fail on raised exceptions
authorThorsten <mail@aero2k.de>
Mon, 11 Apr 2022 12:18:36 +0000 (14:18 +0200)
committerThorsten <mail@aero2k.de>
Mon, 11 Apr 2022 12:18:36 +0000 (14:18 +0200)
(while on others, it's caught)

distbot/bot/bot.py

index c5170aedbf4b97782ffdde8568d06a8ca87633c9..ab311914a7999f38c48a5b1696472198fc3f706b 100644 (file)
@@ -156,7 +156,12 @@ class Bot(slixmpp.ClientXMPP):
             if self.muted:
                 return
 
-            nick_offset, routing_key = self.get_amqp_routing_key(self.nick, msg)
+            try:
+                nick_offset, routing_key = self.get_amqp_routing_key(self.nick, msg)
+            except ValueError as e:
+                logger.warning("Could not process message, probably failed quoting or similar.")
+                logger.exception(e)
+                return
 
             if msg["type"] == "groupchat":
                 recipient = msg["mucroom"]