From 73e596dac360caecc47fcc144a3683dfd43dccc1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 1 Nov 2020 22:18:48 +0000 Subject: [PATCH] Additional error handling for command parsing --- core/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/bot.py b/core/bot.py index 75cee7c..fce82c8 100644 --- a/core/bot.py +++ b/core/bot.py @@ -172,7 +172,10 @@ class IRCBot(IRCClient): prefix, command, params = parsemsg(line) if command in numeric_to_symbolic: command = numeric_to_symbolic[command] - self.handleCommand(command, prefix, params) + try: + self.handleCommand(command, prefix, params) + except Exception as err: + error(err) except IRCBadMessage: self.badMessage(line, *sys.exc_info())