themes kitten: Nicer error message when no internet connection is present
Fixes #5877
This commit is contained in:
parent
15524ee0fb
commit
d4e34a4c31
1 changed files with 3 additions and 0 deletions
|
|
@ -233,8 +233,11 @@ def fetching_done(themes_or_exception: Union[Themes, str]) -> None:
|
|||
self.redraw_after_category_change()
|
||||
|
||||
def fetch() -> None:
|
||||
from urllib.error import URLError
|
||||
try:
|
||||
themes: Union[Themes, str] = load_themes(self.cli_opts.cache_age)
|
||||
except URLError as e:
|
||||
themes = f'Could not download themes, check your internet connection. Error: {e}'
|
||||
except Exception:
|
||||
themes = format_traceback('Failed to download themes')
|
||||
self.asyncio_loop.call_soon_threadsafe(fetching_done, themes)
|
||||
|
|
|
|||
Loading…
Reference in a new issue