##// END OF EJS Templates
ux: show list of causes for vcs unavailable error page
dan -
r683:4961d77a default
parent child Browse files
Show More
@@ -248,7 +248,6 b' def webob_to_pyramid_http_response(webob'
248
248
249
249
250 def error_handler(exception, request):
250 def error_handler(exception, request):
251 # TODO: dan: replace the old pylons error controller with this
252 from rhodecode.model.settings import SettingsModel
251 from rhodecode.model.settings import SettingsModel
253 from rhodecode.lib.utils2 import AttributeDict
252 from rhodecode.lib.utils2 import AttributeDict
254
253
@@ -277,6 +276,10 b' def error_handler(exception, request):'
277 if not c.rhodecode_name:
276 if not c.rhodecode_name:
278 c.rhodecode_name = 'Rhodecode'
277 c.rhodecode_name = 'Rhodecode'
279
278
279 c.causes = []
280 if hasattr(base_response, 'causes'):
281 c.causes = base_response.causes
282
280 response = render_to_response(
283 response = render_to_response(
281 '/errors/error_document.html', {'c': c}, request=request,
284 '/errors/error_document.html', {'c': c}, request=request,
282 response=base_response)
285 response=base_response)
@@ -127,6 +127,11 b' class VCSServerUnavailable(HTTPBadGatewa'
127 """ HTTP Exception class for VCS Server errors """
127 """ HTTP Exception class for VCS Server errors """
128 code = 502
128 code = 502
129 title = 'VCS Server Error'
129 title = 'VCS Server Error'
130 causes = [
131 'VCS Server is not running',
132 'Incorrect vcs.server=host:port',
133 'Incorrect vcs.server.protocol',
134 ]
130 def __init__(self, message=''):
135 def __init__(self, message=''):
131 self.explanation = 'Could not connect to VCS Server'
136 self.explanation = 'Could not connect to VCS Server'
132 if message:
137 if message:
@@ -39,11 +39,17 b''
39 <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
39 <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
40 %endif
40 %endif
41 <div class="inner-column">
41 <div class="inner-column">
42 <h4>Possible Cause</h4>
42 <h4>Possible Causes</h4>
43 <ul>
43 <ul>
44 % if c.causes:
45 %for cause in c.causes:
46 <li>${cause}</li>
47 %endfor
48 %else:
44 <li>The resource may have been deleted.</li>
49 <li>The resource may have been deleted.</li>
45 <li>You may not have access to this repository.</li>
50 <li>You may not have access to this repository.</li>
46 <li>The link may be incorrect.</li>
51 <li>The link may be incorrect.</li>
52 %endif
47 </ul>
53 </ul>
48 </div>
54 </div>
49 <div class="inner-column">
55 <div class="inner-column">
General Comments 0
You need to be logged in to leave comments. Login now