mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
[improvement] handling internet timeout errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user