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

« back to all changes in this revision

Viewing changes to lib/common/cgirequest.py

  • Committer: wagrant
  • Date: 2008-07-10 04:29:05 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:843
Give interpret_file a gentle mode (on by default, to avoid change in
behaviour). This allows us to turn off the HTML warnings that appear in
responses to broken student code. This is important as it was happening
to both the fileservice and serveservice, masking real errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
        httpcode: An HTTP response status code. Pass a constant from the
255
255
        Request class.
256
256
        """
257
 
        raise common.util.IVLEError(httpcode, message)
 
257
        self.status = 200
 
258
        self.headers_out['X-IVLE-CGI-Error'] = httpcode
 
259
        self.ensure_headers_written()
 
260
        self.write(message)
 
261
        self.flush()
 
262
        sys.exit(self.status)
258
263
 
259
264
    def throw_redirect(self, location):
260
265
        """Writes out an HTTP redirect to the specified URL. Exits the