From cadde543f214a94d709ce3bf5a84fdbc6336b153 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 30 Aug 2021 14:39:54 +0200 Subject: [PATCH] [plugins] Improved handling of plugin loading errors --- flaschengeist/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flaschengeist/app.py b/flaschengeist/app.py index e91f000..0012c6f 100644 --- a/flaschengeist/app.py +++ b/flaschengeist/app.py @@ -54,6 +54,8 @@ def __load_plugins(app): logger.error( f"Plugin {entry_point.name} was enabled, but could not be loaded due to an error.", exc_info=True ) + del plugin + continue if isinstance(plugin, AuthPlugin): logger.debug(f"Found authentication plugin: {entry_point.name}") if entry_point.name == config["FLASCHENGEIST"]["auth"]: @@ -65,6 +67,7 @@ def __load_plugins(app): app.config["FG_PLUGINS"][entry_point.name] = plugin if "FG_AUTH_BACKEND" not in app.config: logger.error("No authentication plugin configured or authentication plugin not found") + raise RuntimeError("No authentication plugin configured or authentication plugin not found") def install_all():