]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Better exception handling in lib/webhooks/forge/mod_info.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 24 Oct 2022 07:40:56 +0000 (09:40 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 24 Oct 2022 07:40:56 +0000 (09:40 +0200)
lib/webhooks/forge/mod_info.py

index a46d9e153bb74c047f1bfe8ce33d491f96ad2975..0474db34a9da91626c8b106c1f7ab6494ef95296 100644 (file)
@@ -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)