Added a bit better diagnostic to IrcCallback.__call__ except clause.

This commit is contained in:
Jeremy Fincher 2003-09-07 06:08:16 +00:00
parent d11d24c420
commit 8dc457961a

View File

@ -59,6 +59,7 @@ class IrcCommandDispatcher(object):
def dispatchCommand(self, command): def dispatchCommand(self, command):
return getattr(self, 'do' + command.capitalize(), None) return getattr(self, 'do' + command.capitalize(), None)
class IrcCallback(IrcCommandDispatcher): class IrcCallback(IrcCommandDispatcher):
"""Base class for standard callbacks. """Base class for standard callbacks.
@ -81,10 +82,10 @@ class IrcCallback(IrcCommandDispatcher):
if method is not None: if method is not None:
try: try:
method(irc, msg) method(irc, msg)
except Exception: except Exception, e:
debug.recoverableException() debug.recoverableException()
s = 'Exception raised by %s.%s' % \ s = 'Exception (%s) raised by %s.%s' % \
(self.__class__.__name__, method.im_func.func_name) (e, self.__class__.__name__, method.im_func.func_name)
debug.msg(s) debug.msg(s)
def reset(self): def reset(self):