Catch exceptions on pronoun update

This commit is contained in:
bad 2022-06-08 19:07:24 +02:00
parent decacb4e87
commit 2579fa4b5c

View file

@ -17,8 +17,11 @@ plugins = load_plugins_for_config(app.config.get("PLUGINS", [{"name": "log"}]))
def trigger_update_pronouns(pronouns: str) -> None:
update = PronounUpdate(pronouns)
[plugin.update_bio(update) for plugin in plugins]
for plugin in plugins:
try:
plugin.update_bio(update)
except Exception as e:
print(f"Failed to update pronouns with the gitea plugin {plugin.name}. \n {e}")
@app.route("/update_pronouns", methods=["POST"])
def update_pronouns() -> Tuple[str, int]: