Mercurial > libervia-backend
changeset 1889:be61c5c5e474
plugin text commands: fixed log in genericErrback which was raising an exception when something than StanzaError was received
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 07 Mar 2016 13:49:13 +0100 |
parents | 7b9cdde29d8b |
children | 0a45bc8e7cf4 |
files | src/plugins/plugin_misc_text_commands.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_text_commands.py Sat Mar 05 20:19:40 2016 +0100 +++ b/src/plugins/plugin_misc_text_commands.py Mon Mar 07 13:49:13 2016 +0100 @@ -210,7 +210,11 @@ 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