Conditions | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
22 | @expose('pyjobsweb.templates.error') |
||
23 | def document(self, *args, **kwargs): |
||
24 | """Render the error document""" |
||
25 | resp = request.environ.get('tg.original_response') |
||
26 | try: |
||
27 | # tg.abort exposes the message as .detail in response |
||
28 | message = resp.detail |
||
29 | except: |
||
30 | message = None |
||
31 | |||
32 | if not message: |
||
33 | message = ("<p>We're sorry but we weren't able to process " |
||
34 | " this request.</p>") |
||
35 | |||
36 | values = dict(prefix=request.environ.get('SCRIPT_NAME', ''), |
||
37 | code=request.params.get('code', resp.status_int), |
||
38 | message=request.params.get('message', message)) |
||
39 | return values |
||
40 |