Mercurial > p > roundup > code
diff cgi-bin/roundup.cgi @ 3278:ca122bc16277 maint-0.8
merge from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 13 Apr 2005 06:11:15 +0000 |
| parents | a9e1fff1e793 |
| children | b4c470ee23a4 |
line wrap: on
line diff
--- a/cgi-bin/roundup.cgi Thu Apr 07 07:38:29 2005 +0000 +++ b/cgi-bin/roundup.cgi Wed Apr 13 06:11:15 2005 +0000 @@ -16,12 +16,12 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup.cgi,v 1.40 2004-07-27 00:57:17 richard Exp $ +# $Id: roundup.cgi,v 1.40.2.1 2005-04-13 06:11:14 richard Exp $ # python version check from roundup import version_check from roundup.i18n import _ -import sys +import sys, time # ## Configuration @@ -42,8 +42,9 @@ # ROUNDUP_LOG is the name of the logfile; if it's empty or does not exist, # logging is turned off (unless you changed the default below). -# ROUNDUP_DEBUG is a debug level, currently only 0 (OFF) and 1 (ON) are -# used in the code. Higher numbers means more debugging output. +# DEBUG_TO_CLIENT specifies whether debugging goes to the HTTP server (via +# stderr) or to the web client (via cgitb). +DEBUG_TO_CLIENT = False # This indicates where the Roundup tracker lives TRACKER_HOMES = { @@ -211,7 +212,16 @@ except: sys.stdout, sys.stderr = out, err out.write('Content-Type: text/html\n\n') - cgitb.handler() + if DEBUG_TO_CLIENT: + cgitb.handler() + else: + out.write(cgitb.breaker()) + ts = time.ctime() + out.write('''<p>%s: An error occurred. Please check + the server log for more infomation.</p>'''%ts) + print >> sys.stderr, 'EXCEPTION AT', ts + traceback.print_exc(0, sys.stderr) + sys.stdout.flush() sys.stdout, sys.stderr = out, err LOG.close()
