Added a log.exception to Owner.eval.

This commit is contained in:
Jeremy Fincher 2004-10-10 03:17:18 +00:00
parent 4c37c1c79b
commit 9363489e32

View File

@ -384,7 +384,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
Evaluates <expression> (which should be a Python expression) and
returns its value. If an exception is raised, reports the
exception.
exception (and logs the traceback to the bot's logfile).
"""
if conf.allowEval:
s = privmsgs.getArgs(args)
@ -398,7 +398,10 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
except SyntaxError, e:
irc.reply('%s: %r' % (utils.exnToString(e), s))
except Exception, e:
irc.reply(utils.exnToString(e))
self.log.exception('Uncaught exception in Owner.eval. '
'This is not a bug. Please do not '
'report it.')
irc.reply(utils.exnToString(e)j
else:
# There's a potential that allowEval got changed after we were
# loaded. Let's be extra-special-safe.