From 0473c57291edfc21e3a3b3f4549a26669ed12f48 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())