From c4ade3cbcab753873f14f3fb4daf5a34089bde49 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 19 Jan 2011 10:21:14 -0600 Subject: [PATCH] catch all Exception when calling the handlers, to avoid a crash there. this used to be in the bot before we moved this code around --- DrBotIRC.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/DrBotIRC.py b/DrBotIRC.py index 0c8fcb1..0418b27 100644 --- a/DrBotIRC.py +++ b/DrBotIRC.py @@ -233,11 +233,14 @@ class DrBotIRC(irclib.IRC): # aliases resolved. run result against each module for (priority, handler) in self.internal_bus: - ret = handler(connection, event, nick, userhost, attempt, admin_unlocked) - if ret is not None: - # a module had a result for us, post-alias, so return it - # TODO: scan all modules with compounding results - return ret + try: + ret = handler(connection, event, nick, userhost, attempt, admin_unlocked) + if ret is not None: + # a module had a result for us, post-alias, so return it + # TODO: scan all modules with compounding results + return ret + except Exception as e: + print('EXCEPTION: ' + str(e)) def quit_irc(self, connection, msg): for module in self.modlist: