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:
|
||||
# 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))
|
||||
|
@ -53,6 +53,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