[improvement] handling internet timeout errors

This commit is contained in:
Vinícius Moreira
2020-02-11 17:27:24 -03:00
parent fb8229e1ac
commit 2b9f4bf69f
2 changed files with 2 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ def is_available(client: HttpClient, logger: logging.Logger) -> bool:
try:
client.exists('https://google.com')
return True
except requests.exceptions.ConnectionError:
except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout):
if logger:
logger.warning('Internet connection seems to be off')
return False