themes kitten: Nicer error message when no internet connection is present
Fixes #5877
This commit is contained in:
parent
15524ee0fb
commit
d4e34a4c31
@ -233,8 +233,11 @@ class ThemesHandler(Handler):
|
|||||||
self.redraw_after_category_change()
|
self.redraw_after_category_change()
|
||||||
|
|
||||||
def fetch() -> None:
|
def fetch() -> None:
|
||||||
|
from urllib.error import URLError
|
||||||
try:
|
try:
|
||||||
themes: Union[Themes, str] = load_themes(self.cli_opts.cache_age)
|
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:
|
except Exception:
|
||||||
themes = format_traceback('Failed to download themes')
|
themes = format_traceback('Failed to download themes')
|
||||||
self.asyncio_loop.call_soon_threadsafe(fetching_done, themes)
|
self.asyncio_loop.call_soon_threadsafe(fetching_done, themes)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user