22
22
from loggerhead.controllers import TemplatedBranchView
23
23
from loggerhead import util
25
26
class ErrorUI(TemplatedBranchView):
27
28
template_path = 'loggerhead.templates.error'
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
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)
37
directory_breadcrumbs = (
38
util.directory_breadcrumbs(
39
self._branch.friendly_name,
38
directory_breadcrumbs = util.directory_breadcrumbs(
39
self._branch.friendly_name, self._branch.is_root, 'changes')
43
41
'branch': self._branch,
44
'error_title': 'An unexpected error occurred while proccesing the request:',
42
'error_title': ('An unexpected error occurred while'
43
'processing the request:'),
45
44
'error_description': description.getvalue(),
46
45
'directory_breadcrumbs': directory_breadcrumbs,