diff --git a/rhodecode/lib/exceptions.py b/rhodecode/lib/exceptions.py --- a/rhodecode/lib/exceptions.py +++ b/rhodecode/lib/exceptions.py @@ -132,6 +132,7 @@ class VCSServerUnavailable(HTTPBadGatewa 'Incorrect vcs.server=host:port', 'Incorrect vcs.server.protocol', ] + def __init__(self, message=''): self.explanation = 'Could not connect to VCS Server' if message: diff --git a/rhodecode/lib/vcs/client_http.py b/rhodecode/lib/vcs/client_http.py --- a/rhodecode/lib/vcs/client_http.py +++ b/rhodecode/lib/vcs/client_http.py @@ -197,6 +197,13 @@ def _remote_call(url, payload, exception response = session.post(url, data=msgpack.packb(payload)) except pycurl.error as e: raise exceptions.HttpVCSCommunicationError(e) + except Exception as e: + message = getattr(e, 'message', '') + if 'Failed to connect' in message: + # gevent doesn't return proper pycurl errors + raise exceptions.HttpVCSCommunicationError(e) + else: + raise if response.status_code >= 400: log.error('Call to %s returned non 200 HTTP code: %s',