From 8857878ec2fe6712de46347b5a2d65c64b94ee28 Mon Sep 17 00:00:00 2001 From: James Woglom Date: Mon, 29 Aug 2022 19:01:50 -0400 Subject: show error if static assets are not found --- app/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/main.py b/app/main.py index ecc5040..dcacfec 100644 --- a/app/main.py +++ b/app/main.py @@ -116,7 +116,13 @@ if config.URL_PREFIX != '/': routes.static(config.URL_PREFIX + 'favicon/', 'favicon') routes.static(config.URL_PREFIX + 'download/', config.DOWNLOAD_DIR) routes.static(config.URL_PREFIX, 'ui/dist/metube') -app.add_routes(routes) +try: + app.add_routes(routes) +except ValueError as e: + if 'ui/dist/metube' in str(e): + raise RuntimeError('Could not find the frontend UI static assets. Please run `node_modules/.bin/ng build`') from e + raise e + # https://github.com/aio-libs/aiohttp/pull/4615 waiting for release -- cgit