plugin text commands: fixed log in genericErrback which was raising an exception when something than StanzaError was received

This commit is contained in:
Goffi 2016-03-07 13:49:13 +01:00
commit e56883c613

View file

@ -210,7 +210,11 @@ class TextCommands(object):
raise failure.Failure(exceptions.CancelError())
def genericErrback(failure):
self.feedBack("Command failed with condition '%s'" % failure.value.condition, mess_data, profile)
try:
msg = u"with condition {}".format(failure.value.condition)
except AttributeError:
msg = u"with error {}".format(failure.value)
self.feedBack(u"Command failed {}".format(msg), mess_data, profile)
return False
mess_data["unparsed"] = msg[1 + len(command):] # part not yet parsed of the message