~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/error_ui.py

Merge my old pep8 branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from loggerhead.controllers import TemplatedBranchView
23
23
from loggerhead import util
24
24
 
 
25
 
25
26
class ErrorUI(TemplatedBranchView):
26
27
 
27
28
    template_path = 'loggerhead.templates.error'
28
29
 
29
30
    def __init__(self, branch, exc_info):
30
 
        super(ErrorUI, self).__init__(branch, None)
 
31
        super(ErrorUI, self).__init__(branch, lambda:None)
31
32
        self.exc_info = exc_info
32
33
 
33
 
    def get_values(self, h, args, kw, headers):
 
34
    def get_values(self, path, kwargs, response):
34
35
        exc_type, exc_object, exc_tb = self.exc_info
35
36
        description = StringIO()
36
37
        traceback.print_exception(exc_type, exc_object, None, file=description)
41
42
                'changes'))
42
43
        return {
43
44
            'branch': self._branch,
44
 
            'error_title': 'An unexpected error occurred while proccesing the request:',
 
45
            'error_title': ('An unexpected error occurred while'
 
46
                            'proccesing the request:'),
45
47
            'error_description': description.getvalue(),
46
48
            'directory_breadcrumbs': directory_breadcrumbs,
47
49
        }