From 5be3ccbf385d9a389dba822eb6fecda3e273193e Mon Sep 17 00:00:00 2001 From: souliane Date: Sun, 19 Oct 2014 15:25:04 +0200 Subject: [PATCH] plugin XEP-0054: fixes error message when we get a ConnectionLost failure --- src/plugins/plugin_xep_0054.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin_xep_0054.py b/src/plugins/plugin_xep_0054.py index 230832ea..58b83c2e 100755 --- a/src/plugins/plugin_xep_0054.py +++ b/src/plugins/plugin_xep_0054.py @@ -204,8 +204,11 @@ class XEP_0054(object): 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):