changeset 3943:8dc6a4cfda4b

plugin XEP-0384: continue workflow and log error in case of issue in self.__prepare_for_profile: an exception while preparing profile should not stop the message to be propagated
author Goffi <goffi@goffi.org>
date Sat, 15 Oct 2022 20:38:33 +0200
parents a92eef737703
children 748094d5a74d
files sat/plugins/plugin_xep_0384.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0384.py	Sat Oct 15 20:38:33 2022 +0200
+++ b/sat/plugins/plugin_xep_0384.py	Sat Oct 15 20:38:33 2022 +0200
@@ -1591,7 +1591,12 @@
             None
         ))
 
-        session_manager = await self.__prepare_for_profile(cast(str, client.profile))
+        try:
+            session_manager = await self.__prepare_for_profile(cast(str, client.profile))
+        except Exception as e:
+            log.error(f"error while preparing profile for {client.profile}: {e}")
+            # we don't want to block the workflow
+            return True
 
         if twomemo_encrypted_elt is not None:
             try: