changeset 1232:6b10442e8920

plugin XEP-0115: trap "service-unavailable" error when retrieving disco infos
author souliane <souliane@mailoo.org>
date Tue, 07 Oct 2014 10:19:01 +0200
parents 93a5e2673929
children 0b87d029f0a3
files src/plugins/plugin_xep_0115.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0115.py	Tue Oct 07 11:45:34 2014 +0200
+++ b/src/plugins/plugin_xep_0115.py	Tue Oct 07 10:19:01 2014 +0200
@@ -150,7 +150,11 @@
             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})