From 0ca6a3f2f9683972fc2f763b73ffa38bab3144be Mon Sep 17 00:00:00 2001 From: Andrew Brain <61482022+ABrain7710@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:04:08 +0100 Subject: [PATCH] Add exception to catch protocol error Signed-off-by: Andrew Brain <61482022+ABrain7710@users.noreply.github.com> --- augur/tasks/github/util/github_paginator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/augur/tasks/github/util/github_paginator.py b/augur/tasks/github/util/github_paginator.py index 296501430b..1ef8e029ff 100644 --- a/augur/tasks/github/util/github_paginator.py +++ b/augur/tasks/github/util/github_paginator.py @@ -44,6 +44,10 @@ def hit_api(key_manager, url: str, logger: logging.Logger, timeout: float = 10, logger.info(f"Network Error. Sleeping {round(timeout)} seconds and trying again...\n") time.sleep(round(timeout)) return None + except httpx.ProtocolError: + logger.info(f"Protocol Error. Sleeping {round(timeout*1.5)} seconds and trying again...\n") + time.sleep(round(timeout*1.5)) + return None return response