# HG changeset patch # User Goffi # Date 1657796130 -7200 # Node ID a56d5ad466b3e4cd26d5a42eed471d625bc4df6e # Parent 384ad98ea9fe5ae896a06c89621f8d190a1b0836 component AP gateway: fix wrong exception + use of mb_data["xml"] when it may be absent diff -r 384ad98ea9fe -r a56d5ad466b3 sat/plugins/plugin_comp_ap_gateway/__init__.py --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py Thu Jul 14 12:55:30 2022 +0200 +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py Thu Jul 14 12:55:30 2022 +0200 @@ -1404,7 +1404,7 @@ Can be either an activity of an object @return: AP Item's Object and microblog data @raise exceptions.DataError: something is invalid in the AP item - @raise NotImplemented: some AP data is not handled yet + @raise NotImplementedError: some AP data is not handled yet @raise error.StanzaError: error while contacting the AP server """ is_activity = self.isActivity(ap_item) @@ -1751,14 +1751,14 @@ if client != self.client: return mess_data if mess_data["type"] not in ("chat", "normal"): - log.warning(f"ignoring message with unexpected type: {mess_data['xml'].toXml()}") + log.warning(f"ignoring message with unexpected type: {mess_data}") return mess_data if not self.isLocal(mess_data["from"]): - log.warning(f"ignoring non local message: {mess_data['xml'].toXml()}") + log.warning(f"ignoring non local message: {mess_data}") return mess_data if not mess_data["to"].user: log.warning( - f"ignoring message addressed to gateway itself: {mess_data['xml'].toXml()}" + f"ignoring message addressed to gateway itself: {mess_data}" ) return mess_data @@ -1967,7 +1967,7 @@ # we don't have a comment node set for this item from sat.tools.xml_tools import ppElt log.info(f"{ppElt(parent_item_elt.toXml())}") - raise NotImplemented() + raise NotImplementedError() else: __, item_elt = await self.apItem2MbDataAndElt(ap_item) await self._p.publish(client, comment_service, comment_node, [item_elt])