From a73d0694f686176b2fdea4b4a3e820082a00c47e Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 6 Jul 2022 16:35:18 +0200 Subject: [PATCH] [core] Handle ConnectionError exception on login Fixes #447 --- legendary/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 6520636..3b5a60a 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -15,7 +15,7 @@ from locale import getdefaultlocale from multiprocessing import Queue from platform import system from requests import session -from requests.exceptions import HTTPError +from requests.exceptions import HTTPError, ConnectionError from sys import platform as sys_platform from uuid import uuid4 from urllib.parse import urlencode, parse_qsl @@ -229,7 +229,7 @@ class LegendaryCore: self.log.error('Stored credentials are no longer valid! Please login again.') self.lgd.invalidate_userdata() return False - except HTTPError as e: + except (HTTPError, ConnectionError) as e: self.log.error(f'HTTP request for login failed: {e!r}, please try again later.') return False