Blame | Last modification | View Log | RSS feed
# -*- coding: utf-8 -*-"""Error controller"""from tg import request, expose__all__ = ['ErrorController']class ErrorController(object):"""Generates error documents as and when they are required.The ErrorDocuments middleware forwards to ErrorController when errorrelated status codes are returned from the application.This behaviour can be altered by changing the parameters to theErrorDocuments middleware in your config/middleware.py file."""@expose('wiki20.templates.error')def document(self, *args, **kwargs):"""Render the error document"""resp = request.environ.get('pylons.original_response')default_message = ("<p>We're sorry but we weren't able to process "" this request.</p>")values = dict(prefix=request.environ.get('SCRIPT_NAME', ''),code=request.params.get('code', resp.status_int),message=request.params.get('message', default_message))return values