mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 00:24:15 +02:00
[improvement] handling internet timeout errors
This commit is contained in:
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- UI:
|
- UI:
|
||||||
- **Settings** available as a tray action as well
|
- **Settings** available as a tray action as well
|
||||||
- minor improvements
|
- minor improvements
|
||||||
|
- handling internet timeout errors
|
||||||
|
|
||||||
## [0.8.2] - 2020-01-31
|
## [0.8.2] - 2020-01-31
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ def is_available(client: HttpClient, logger: logging.Logger) -> bool:
|
|||||||
try:
|
try:
|
||||||
client.exists('https://google.com')
|
client.exists('https://google.com')
|
||||||
return True
|
return True
|
||||||
except requests.exceptions.ConnectionError:
|
except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout):
|
||||||
if logger:
|
if logger:
|
||||||
logger.warning('Internet connection seems to be off')
|
logger.warning('Internet connection seems to be off')
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user