convert third-party exception to ConnectionError
fixes bug #1207635 Change-Id: I37da522e812286e72706409b8a6d4652515f720f
This commit is contained in:
parent
55b2161c8f
commit
c95e59f510
cinderclient
@ -192,7 +192,8 @@ class HTTPClient(object):
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
# Catch a connection refused from requests.request
|
||||
self._logger.debug("Connection refused: %s" % e)
|
||||
raise
|
||||
msg = 'Unable to establish connection: %s' % e
|
||||
raise exceptions.ConnectionError(msg)
|
||||
self._logger.debug(
|
||||
"Failed attempt(%s of %s), retrying in %s seconds" %
|
||||
(attempts, self.retries, backoff))
|
||||
|
@ -39,6 +39,11 @@ class EndpointNotFound(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class ConnectionError(Exception):
|
||||
"""Could not open a connection to the API service."""
|
||||
pass
|
||||
|
||||
|
||||
class AmbiguousEndpoints(Exception):
|
||||
"""Found more than one matching endpoint in Service Catalog."""
|
||||
def __init__(self, endpoints=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user