From be4fda30ddc463ce2bfe353166ac2b770edcba12 Mon Sep 17 00:00:00 2001 From: souliane Date: Tue, 7 Oct 2014 10:19:01 +0200 Subject: [PATCH] plugin XEP-0115: trap "service-unavailable" error when retrieving disco infos --- src/plugins/plugin_xep_0115.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/plugin_xep_0115.py b/src/plugins/plugin_xep_0115.py index 9ea0d50c..27733536 100755 --- a/src/plugins/plugin_xep_0115.py +++ b/src/plugins/plugin_xep_0115.py @@ -150,7 +150,11 @@ class XEP_0115_handler(XMPPHandler): self.host.memory.updateEntityData(from_jid, C.ENTITY_CAP_HASH, c_ver, self.profile) return - yield self.host.getDiscoInfos(from_jid, self.profile) + try: + yield self.host.getDiscoInfos(from_jid, self.profile) + except Exception, e: + log.error(_("Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=e.condition)) + return if c_hash != 'sha-1': #unknown hash method log.warning(_('Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node})