From 410e6b5e7d5e6ecc89e9634dc1558540a068911d Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 3 Jun 2010 18:19:41 +0200 Subject: Catch exceptions from modules. --- fot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'fot.py') 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) -- cgit v1.2.3