From f05fd07685b53de505a51366b3f1c8929dfb1506 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 24 Oct 2022 09:40:56 +0200 Subject: [PATCH] Better exception handling in lib/webhooks/forge/mod_info.py --- lib/webhooks/forge/mod_info.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/webhooks/forge/mod_info.py b/lib/webhooks/forge/mod_info.py index a46d9e1..0474db3 100644 --- a/lib/webhooks/forge/mod_info.py +++ b/lib/webhooks/forge/mod_info.py @@ -20,7 +20,7 @@ import time import requests import pytz -from requests.exceptions import ReadTimeout, ConnectTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout # Own modules from fb_tools.common import pp, to_bool @@ -38,7 +38,7 @@ from .cur_mod_release_info import CurrentModuleReleaseInfo from .owner_info import ForgeOwnerInfo -__version__ = '0.3.3' +__version__ = '0.3.4' LOG = logging.getLogger(__name__) @@ -508,7 +508,7 @@ class ForgeModuleInfo(BaseModuleInfo): warnings.simplefilter("always") try: response = session.request('GET', url, timeout=http_timeout) - except (ReadTimeout, ConnectTimeout) as e: + except (ConnectionError, ReadTimeout, ConnectTimeout) as e: msg = "{c} on getting module info for {m}: {e}".format( c=e.__class__.__name__, m=full_name, e=e) raise BaseHookError(msg) -- 2.39.5