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