From 37e804402197426d20c2854603e6dd1346e451ea Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Mon, 30 Oct 2023 14:44:35 -0500 Subject: [PATCH 1/2] fixed warning message thrown when logging in --- balsam/client/requests_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/balsam/client/requests_client.py b/balsam/client/requests_client.py index 902df966..5e918328 100644 --- a/balsam/client/requests_client.py +++ b/balsam/client/requests_client.py @@ -98,9 +98,13 @@ def request( except requests.Timeout as exc: logger.warning(f"Attempt Retry of Timed-out request {http_method} {absolute_url}") self.backoff(exc) - except (requests.ConnectionError, requests.HTTPError) as exc: + except requests.ConnectionError as exc: logger.warning(f"Attempt retry ({self._attempt} of {self.retry_count}) of connection: {exc}") self.backoff(exc) + except requests.HTTPError as exc: + if authenticating == False: + logger.warning(f"Attempt retry ({self._attempt} of {self.retry_count}) of connection: {exc}") + self.backoff(exc) else: try: return response.json() # type: ignore From e7bde0e5112f885a9b6cf8a152e4039f7ef7b7d3 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Mon, 30 Oct 2023 14:48:39 -0500 Subject: [PATCH 2/2] fixed warning message thrown when logging in --- balsam/client/requests_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balsam/client/requests_client.py b/balsam/client/requests_client.py index 5e918328..2be7cca6 100644 --- a/balsam/client/requests_client.py +++ b/balsam/client/requests_client.py @@ -102,7 +102,7 @@ def request( logger.warning(f"Attempt retry ({self._attempt} of {self.retry_count}) of connection: {exc}") self.backoff(exc) except requests.HTTPError as exc: - if authenticating == False: + if authenticating is False: logger.warning(f"Attempt retry ({self._attempt} of {self.retry_count}) of connection: {exc}") self.backoff(exc) else: