# HG changeset patch # User souliane # Date 1413725104 -7200 # Node ID 77a4592816f627f1cb6f834786562c2cff371e91 # Parent c6cf44e6330b8cf851a5e894e8606a5afd983cb4 plugin XEP-0054: fixes error message when we get a ConnectionLost failure diff -r c6cf44e6330b -r 77a4592816f6 src/plugins/plugin_xep_0054.py --- a/src/plugins/plugin_xep_0054.py Sun Oct 19 15:07:16 2014 +0200 +++ b/src/plugins/plugin_xep_0054.py Sun Oct 19 15:25:04 2014 +0200 @@ -204,8 +204,11 @@ def vcard_err(self, failure, profile): """Called when something is wrong with registration""" - if failure.value.stanza.hasAttribute("from"): - log.error(_("Can't find VCard of %s") % failure.value.stanza['from']) + try: + if failure.value.stanza.hasAttribute("from"): + log.error(_("Can't find VCard of %s") % failure.value.stanza['from']) + except AttributeError: + log.error(_("Can't find VCard: %s") % failure.getErrorMessage()) self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) # FIXME: maybe an error message would be better def getCard(self, target_s, profile_key=C.PROF_KEY_NONE):