Merge "Correct reraising of exception"
This commit is contained in:
commit
661570fc20
|
@ -242,20 +242,20 @@ class HTTPClient(object):
|
||||||
try:
|
try:
|
||||||
return self.request(
|
return self.request(
|
||||||
method, self.concat_url(endpoint, url), **kwargs)
|
method, self.concat_url(endpoint, url), **kwargs)
|
||||||
except exceptions.ConnectionRefused as refused_ex:
|
except exceptions.ConnectionRefused:
|
||||||
print('ERROR: Cannot connect to %s. Make sure it ' +
|
print('ERROR: Cannot connect to %s. Make sure it ' +
|
||||||
'is valid: %s.' % endpoint)
|
'is valid: %s.' % endpoint)
|
||||||
raise refused_ex
|
raise
|
||||||
except exceptions.EndpointException as endpoint_ex:
|
except exceptions.EndpointException:
|
||||||
print('ERROR: Service catalog endpoint is invalid. ' +
|
print('ERROR: Service catalog endpoint is invalid. ' +
|
||||||
'Please check your ' +
|
'Please check your ' +
|
||||||
'endpoint is valid: %s.' % endpoint)
|
'endpoint is valid: %s.' % endpoint)
|
||||||
raise endpoint_ex
|
raise
|
||||||
except requests.ConnectionError as conn_err:
|
except requests.ConnectionError:
|
||||||
print('ERROR: Unable to connect to endpoint. ' +
|
print('ERROR: Unable to connect to endpoint. ' +
|
||||||
'Make sure that ' +
|
'Make sure that ' +
|
||||||
'your endpoint (%s) is valid.' % endpoint)
|
'your endpoint (%s) is valid.' % endpoint)
|
||||||
raise conn_err
|
raise
|
||||||
except exceptions.Unauthorized as unauth_ex:
|
except exceptions.Unauthorized as unauth_ex:
|
||||||
if just_authenticated:
|
if just_authenticated:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue