]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/controllers/error.py
Convert the README to rST, since that's what distutils wants.
[bluechips.git] / bluechips / controllers / error.py
1 import cgi
2
3 from pylons import request, tmpl_context as c
4
5 from bluechips.lib.base import BaseController, render
6
7 class ErrorController(BaseController):
8     """Generates error documents as and when they are required.
9
10     The ErrorDocuments middleware forwards to ErrorController when error
11     related status codes are returned from the application.
12
13     This behaviour can be altered by changing the parameters to the
14     ErrorDocuments middleware in your config/middleware.py file.
15     
16     """
17     def document(self):
18         """Render the error document"""
19         resp = request.environ.get('pylons.original_response')
20         c.code = cgi.escape(request.GET.get('code', resp.status))
21         return render('/error.mako')