[plugins] Improved handling of plugin loading errors

This commit is contained in:
Ferdinand Thiessen 2021-08-30 14:39:54 +02:00
parent 4e46ea1ca3
commit cadde543f2
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,8 @@ def __load_plugins(app):
logger.error( logger.error(
f"Plugin {entry_point.name} was enabled, but could not be loaded due to an error.", exc_info=True 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): if isinstance(plugin, AuthPlugin):
logger.debug(f"Found authentication plugin: {entry_point.name}") logger.debug(f"Found authentication plugin: {entry_point.name}")
if entry_point.name == config["FLASCHENGEIST"]["auth"]: if entry_point.name == config["FLASCHENGEIST"]["auth"]:
@ -65,6 +67,7 @@ def __load_plugins(app):
app.config["FG_PLUGINS"][entry_point.name] = plugin app.config["FG_PLUGINS"][entry_point.name] = plugin
if "FG_AUTH_BACKEND" not in app.config: if "FG_AUTH_BACKEND" not in app.config:
logger.error("No authentication plugin configured or authentication plugin not found") 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(): def install_all():