[gozerbot] push by bthate - make exceptions only output to logs by default on 2012-08-06 12:11 GMT

0 views
Skip to first unread message

goze...@googlecode.com

unread,
Aug 6, 2012, 8:11:37 AM8/6/12
to gozerbo...@googlegroups.com
Revision: 6fa9f07bad55
Author: Bart Thate <bth...@gmail.com>
Date: Mon Aug 6 05:10:57 2012
Log: make exceptions only output to logs by default
http://code.google.com/p/gozerbot/source/detail?r=6fa9f07bad55

Modified:
/gozerbot/utils/exception.py

=======================================
--- /gozerbot/utils/exception.py Sun Jan 22 20:57:24 2012
+++ /gozerbot/utils/exception.py Mon Aug 6 05:10:57 2012
@@ -51,7 +51,7 @@

## handle_exception function

-def handle_exception(event=None, log=True, short=False, txt=""):
+def handle_exception(event=None, log=True, short=False, txt="",
public=False):
""" generic exception handler, prints out the exception trace. """
global borkonexception
errormsg = exceptionmsg()
@@ -64,7 +64,8 @@
rlog(1000, 'EXCEPTION', 'options: ' + str(event.options))
exceptionevents.append((event, errormsg))
if event.bot: event.bot.error = errormsg
- event.reply(errormsg)
+ if public: event.reply(errormsg)
+ else: event.reply("an exception occured, see logs.")
if borkonexception:
rlog(1000, 'EXCEPTION', "BORK ON EXCEPTION")
sys.stdout.flush()
Reply all
Reply to author
Forward
0 new messages