From 8df9ed851a5418e23e75a3b10eaf97a6cac8e90c Mon Sep 17 00:00:00 2001 From: Miguel Gagliardo Date: Thu, 20 Dec 2018 12:24:15 -0300 Subject: [PATCH] Adding Timeout Error catch --- purestorage/purestorage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/purestorage/purestorage.py b/purestorage/purestorage.py index 5a06d66..ae67a81 100644 --- a/purestorage/purestorage.py +++ b/purestorage/purestorage.py @@ -15,7 +15,6 @@ # The current version of this library. VERSION = "1.16.0" - class FlashArray(object): """Represents a Pure Storage FlashArray and exposes administrative APIs. @@ -161,6 +160,8 @@ def _request(self, method, path, data=None, reestablish_session=True): try: response = requests.request(method, url, data=body, headers=headers, cookies=self._cookies, **self._request_kwargs) + except requests.exceptions.ConnectTimeout as timeouterr: + raise PureError(timeouterr) except requests.exceptions.RequestException as err: # error outside scope of HTTP status codes # e.g. unable to resolve domain name @@ -3761,4 +3762,3 @@ def __str__(self): "version {1} at {2}: {3}\n{4}") return msg.format(self.code, self.rest_version, self.target, self.reason, self.text) -