From 89752eed4aabcaa9d18c66e9bcde246e5928d782 Mon Sep 17 00:00:00 2001 From: Aran-Fey Date: Mon, 18 Nov 2024 22:38:51 +0100 Subject: [PATCH] fix crash if app_main_module doesn't exist --- rio/cli/run_project/app_loading.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rio/cli/run_project/app_loading.py b/rio/cli/run_project/app_loading.py index b50d821d..5521482b 100644 --- a/rio/cli/run_project/app_loading.py +++ b/rio/cli/run_project/app_loading.py @@ -239,11 +239,15 @@ def load_user_app( # Import the app module try: app_module = import_app_module(proj) + except FileNotFoundError as err: + revel.error( + f"Could not import `{proj.app_main_module_name}`: Module not found" + ) + raise AppLoadError() from err except ImportError as err: assert err.__cause__ is not None, err revel.error(f"Could not import `{proj.app_main_module_name}`:") - revel.print( nice_traceback.format_exception_revel( err.__cause__,