ux: show list of causes for vcs unavailable error page
This commit is contained in:
parent
5a3574412b
commit
8ed80c1c7f
3 changed files with 16 additions and 2 deletions
|
|
@ -248,7 +248,6 @@ def webob_to_pyramid_http_response(webob_response):
|
|||
|
||||
|
||||
def error_handler(exception, request):
|
||||
# TODO: dan: replace the old pylons error controller with this
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
from rhodecode.lib.utils2 import AttributeDict
|
||||
|
||||
|
|
@ -277,6 +276,10 @@ def error_handler(exception, request):
|
|||
if not c.rhodecode_name:
|
||||
c.rhodecode_name = 'Rhodecode'
|
||||
|
||||
c.causes = []
|
||||
if hasattr(base_response, 'causes'):
|
||||
c.causes = base_response.causes
|
||||
|
||||
response = render_to_response(
|
||||
'/errors/error_document.html', {'c': c}, request=request,
|
||||
response=base_response)
|
||||
|
|
|
|||
|
|
@ -127,6 +127,11 @@ class VCSServerUnavailable(HTTPBadGateway):
|
|||
""" HTTP Exception class for VCS Server errors """
|
||||
code = 502
|
||||
title = 'VCS Server Error'
|
||||
causes = [
|
||||
'VCS Server is not running',
|
||||
'Incorrect vcs.server=host:port',
|
||||
'Incorrect vcs.server.protocol',
|
||||
]
|
||||
def __init__(self, message=''):
|
||||
self.explanation = 'Could not connect to VCS Server'
|
||||
if message:
|
||||
|
|
|
|||
|
|
@ -39,11 +39,17 @@
|
|||
<p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
|
||||
%endif
|
||||
<div class="inner-column">
|
||||
<h4>Possible Cause</h4>
|
||||
<h4>Possible Causes</h4>
|
||||
<ul>
|
||||
% if c.causes:
|
||||
%for cause in c.causes:
|
||||
<li>${cause}</li>
|
||||
%endfor
|
||||
%else:
|
||||
<li>The resource may have been deleted.</li>
|
||||
<li>You may not have access to this repository.</li>
|
||||
<li>The link may be incorrect.</li>
|
||||
%endif
|
||||
</ul>
|
||||
</div>
|
||||
<div class="inner-column">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue