~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: dcoles
  • Date: 2008-02-25 02:26:39 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:562
Added new app: Diff (SVN diff application)
setup.py: Added diffservice script to jail scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
from request import Request
40
40
import html
41
 
import cgi
42
41
import login
43
42
from common import (util, forumutil)
44
43
import traceback
210
209
        if exc_value.message is not None:
211
210
            msg = exc_value.message
212
211
        if codename is not None:
213
 
            req.write("<h1>Error: %s</h1>\n" % cgi.escape(codename))
 
212
            req.write("<h1>Error: %s</h1>\n" % codename)
214
213
        else:
215
214
            req.write("<h1>Error</h1>\n")
216
215
        if msg is not None:
217
 
            req.write("<p>%s</p>\n" % cgi.escape(msg))
 
216
            req.write("<p>%s</p>\n" % msg)
218
217
        else:
219
218
            req.write("<p>An unknown error occured.</p>\n")
220
219
        req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
235
234
        # if available.
236
235
        if hasattr(exc_value, 'message') and exc_value.message is not None:
237
236
            msg = exc_value.message
238
 
            # Prepend the exception type
239
 
            if exc_type != util.IVLEError:
240
 
                msg = exc_type.__name__ + ": " + msg
241
237
 
242
238
        req.write("""<html>
243
239
<head><title>IVLE Internal Server Error</title></head>
245
241
<h1>IVLE Internal Server Error""")
246
242
        if (codename is not None
247
243
            and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
248
 
            req.write(": %s" % cgi.escape(codename))
 
244
            req.write(": %s" % codename)
249
245
        req.write("""</h1>
250
246
<p>An error has occured which is the fault of the IVLE developers or
251
247
administration.</p>
252
248
""")
253
249
        if msg is not None:
254
 
            req.write("<p>%s</p>\n" % cgi.escape(msg))
 
250
            req.write("<p>%s</p>\n" % msg)
255
251
        if httpcode is not None:
256
252
            req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
257
253
        req.write("""
258
254
<p>Please report this to <a href="mailto:%s">%s</a> (the system
259
255
administrator). Include the following information:</p>
260
 
""" % (cgi.escape(admin_email), cgi.escape(admin_email)))
 
256
""" % (admin_email, admin_email))
261
257
 
262
258
        tb_print = cStringIO.StringIO()
263
259
        traceback.print_exception(exc_type, exc_value, exc_traceback,
264
260
            file=tb_print)
265
261
        req.write("<pre>\n")
266
 
        req.write(cgi.escape(tb_print.getvalue()))
 
262
        req.write(tb_print.getvalue())
267
263
        req.write("</pre>\n</body>\n")