From 2579fa4b5ced694fb30afbc329d68d242d67dcc7 Mon Sep 17 00:00:00 2001 From: bad Date: Wed, 8 Jun 2022 19:07:24 +0200 Subject: [PATCH] Catch exceptions on pronoun update --- src/core/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/app.py b/src/core/app.py index 5a43758..8a93de2 100644 --- a/src/core/app.py +++ b/src/core/app.py @@ -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]: