summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-06-03 18:19:41 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-06-03 18:19:41 +0200
commit410e6b5e7d5e6ecc89e9634dc1558540a068911d (patch)
tree82e5b9ad090a8505991dbb27fb340f2b8973dbf8
parent209b2f39f1126f1f02d4dc7a0f51233a18a07282 (diff)
Catch exceptions from modules.
-rwxr-xr-xfot.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/fot.py b/fot.py
index 5f313f4..5ecd65d 100755
--- a/fot.py
+++ b/fot.py
@@ -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)