fix crash if app_main_module doesn't exist

This commit is contained in:
Aran-Fey
2024-11-18 22:38:51 +01:00
parent 0c94e2c322
commit 89752eed4a

View File

@@ -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__,