From 98b27ee0463f7071840d01b4ff029995b5ca8c87 Mon Sep 17 00:00:00 2001 From: A_D Date: Fri, 23 Oct 2020 12:40:21 +0200 Subject: [PATCH] Fixed startup exception when unable to connect --- killswitch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/killswitch.py b/killswitch.py index bb674c53..226f8ca0 100644 --- a/killswitch.py +++ b/killswitch.py @@ -78,8 +78,8 @@ def fetch_kill_switches(target=DEFAULT_KILLSWITCH_URL) -> Optional[KILL_SWITCH_J logger.warning(f"Failed to get kill switches, data was invalid: {e}") return None - except requests.exceptions.BaseHTTPError as e: - logger.warning(f"unable to connect to {target:r}: {e}") + except (requests.exceptions.BaseHTTPError, requests.exceptions.ConnectionError) as e: + logger.warning(f"unable to connect to {target!r}: {e}") return None return data