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
1 changed files with 8 additions and 5 deletions

View File

@ -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: