Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0384.py @ 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 | cecf45416403 |
children | 748094d5a74d |
comparison
equal
deleted
inserted
replaced
3942:a92eef737703 | 3943:8dc6a4cfda4b |
---|---|
1589 oldmemo_encrypted_elt = cast(Optional[domish.Element], next( | 1589 oldmemo_encrypted_elt = cast(Optional[domish.Element], next( |
1590 message_elt.elements(oldmemo.oldmemo.NAMESPACE, "encrypted"), | 1590 message_elt.elements(oldmemo.oldmemo.NAMESPACE, "encrypted"), |
1591 None | 1591 None |
1592 )) | 1592 )) |
1593 | 1593 |
1594 session_manager = await self.__prepare_for_profile(cast(str, client.profile)) | 1594 try: |
1595 session_manager = await self.__prepare_for_profile(cast(str, client.profile)) | |
1596 except Exception as e: | |
1597 log.error(f"error while preparing profile for {client.profile}: {e}") | |
1598 # we don't want to block the workflow | |
1599 return True | |
1595 | 1600 |
1596 if twomemo_encrypted_elt is not None: | 1601 if twomemo_encrypted_elt is not None: |
1597 try: | 1602 try: |
1598 message = twomemo.etree.parse_message( | 1603 message = twomemo.etree.parse_message( |
1599 xml_tools.domish_elt_2_et_elt(twomemo_encrypted_elt), | 1604 xml_tools.domish_elt_2_et_elt(twomemo_encrypted_elt), |