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
This commit is contained in:
Brian S. Stephan 2011-01-19 10:21:14 -06:00
parent d592d3f3bb
commit c4ade3cbca

View File

@ -233,11 +233,14 @@ class DrBotIRC(irclib.IRC):
# aliases resolved. run result against each module # aliases resolved. run result against each module
for (priority, handler) in self.internal_bus: for (priority, handler) in self.internal_bus:
ret = handler(connection, event, nick, userhost, attempt, admin_unlocked) try:
if ret is not None: ret = handler(connection, event, nick, userhost, attempt, admin_unlocked)
# a module had a result for us, post-alias, so return it if ret is not None:
# TODO: scan all modules with compounding results # a module had a result for us, post-alias, so return it
return ret # TODO: scan all modules with compounding results
return ret
except Exception as e:
print('EXCEPTION: ' + str(e))
def quit_irc(self, connection, msg): def quit_irc(self, connection, msg):
for module in self.modlist: for module in self.modlist: