From 7f713e39f307d37e6cb64f8b991e7172db93e1c9 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 14 Sep 2020 09:23:23 +0200 Subject: [PATCH] plugin XEP-0329: better error handling in `onComponentAffiliationsGet` --- sat/plugins/plugin_xep_0329.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sat/plugins/plugin_xep_0329.py b/sat/plugins/plugin_xep_0329.py index 6971e0bb..0cb355af 100644 --- a/sat/plugins/plugin_xep_0329.py +++ b/sat/plugins/plugin_xep_0329.py @@ -827,6 +827,12 @@ class XEP_0329(object): peer_jid, owner = self._compParseJids(client, iq_elt) is_owner = peer_jid.userhostJID() == owner affiliations = {owner: 'owner'} + except exceptions.NotFound: + client.sendError(iq_elt, "item-not-found") + return + except Exception as e: + client.sendError(iq_elt, "internal-server-error", str(e)) + return else: from_jid_bare = from_jid.userhostJID() is_owner = from_jid_bare == file_data.get('owner')