A little better error reporting

This commit is contained in:
Jeremy Fincher 2003-03-28 02:33:40 +00:00
parent fb150d0e5b
commit 30591187ad
1 changed files with 8 additions and 1 deletions

View File

@ -70,7 +70,14 @@ class IrcCallback(object):
def __call__(self, irc, msg):
commandName = 'do' + msg.command.capitalize()
if hasattr(self, commandName):
getattr(self, commandName)(irc, msg)
method = getattr(self, commandName)
try:
method(irc, msg)
except Exception, e:
debug.recoverableException()
s = 'Exception raised by %s.%s' % \
(self.__class__.__name__, method.im_func.func_name)
debug.debugMsg(s)
def reset(self):
pass