diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-06-03 18:19:41 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-06-03 18:19:41 +0200 |
commit | 410e6b5e7d5e6ecc89e9634dc1558540a068911d (patch) | |
tree | 82e5b9ad090a8505991dbb27fb340f2b8973dbf8 | |
parent | 209b2f39f1126f1f02d4dc7a0f51233a18a07282 (diff) |
Catch exceptions from modules.
-rwxr-xr-x | fot.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -121,7 +121,10 @@ class Bot(irc.IRCClient): for mod in self.msg_callbacks: if priv or mod in self.module_channels[channel]: - mod.privmsg(nick, channel, msg) + try: + mod.privmsg(nick, channel, msg) + except Exception as e: + print e msg = msg.split(None, 1) if not len(msg): @@ -134,7 +137,10 @@ class Bot(irc.IRCClient): if kw in self.keywords: mod = self.keywords[kw] if priv or mod in self.module_channels[channel]: - mod.keyword(nick, channel, kw, msg) + try: + mod.keyword(nick, channel, kw, msg) + except Exception as e: + print e def kickedFrom(self, channel, kicker, message): self.join(channel) |