From 10dfba8863336c900fbf5c8b2a78c1c7a3380e9e Mon Sep 17 00:00:00 2001 From: Bin Zhou Date: Thu, 7 Jul 2016 20:29:02 +0800 Subject: [PATCH] Correct reraising of exception when an exception was caught and rethrown, it should call 'raise' without any arguments. Change-Id: I2d2cd48bfaee7c983978022664862abb7af045d1 --- solumclient/openstack/common/apiclient/client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/solumclient/openstack/common/apiclient/client.py b/solumclient/openstack/common/apiclient/client.py index 82d56b6..bc54d4b 100644 --- a/solumclient/openstack/common/apiclient/client.py +++ b/solumclient/openstack/common/apiclient/client.py @@ -242,20 +242,20 @@ class HTTPClient(object): try: return self.request( 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 ' + 'is valid: %s.' % endpoint) - raise refused_ex - except exceptions.EndpointException as endpoint_ex: + raise + except exceptions.EndpointException: print('ERROR: Service catalog endpoint is invalid. ' + 'Please check your ' + 'endpoint is valid: %s.' % endpoint) - raise endpoint_ex - except requests.ConnectionError as conn_err: + raise + except requests.ConnectionError: print('ERROR: Unable to connect to endpoint. ' + 'Make sure that ' + 'your endpoint (%s) is valid.' % endpoint) - raise conn_err + raise except exceptions.Unauthorized as unauth_ex: if just_authenticated: raise