Mercurial > libervia-backend
comparison src/plugins/plugin_misc_text_commands.py @ 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 | d17772b0fe22 |
children | 2daf7b4c6756 |
comparison
equal
deleted
inserted
replaced
1888:7b9cdde29d8b | 1889:be61c5c5e474 |
---|---|
208 else: | 208 else: |
209 log.debug("text commands took over") | 209 log.debug("text commands took over") |
210 raise failure.Failure(exceptions.CancelError()) | 210 raise failure.Failure(exceptions.CancelError()) |
211 | 211 |
212 def genericErrback(failure): | 212 def genericErrback(failure): |
213 self.feedBack("Command failed with condition '%s'" % failure.value.condition, mess_data, profile) | 213 try: |
214 msg = u"with condition {}".format(failure.value.condition) | |
215 except AttributeError: | |
216 msg = u"with error {}".format(failure.value) | |
217 self.feedBack(u"Command failed {}".format(msg), mess_data, profile) | |
214 return False | 218 return False |
215 | 219 |
216 mess_data["unparsed"] = msg[1 + len(command):] # part not yet parsed of the message | 220 mess_data["unparsed"] = msg[1 + len(command):] # part not yet parsed of the message |
217 try: | 221 try: |
218 cmd_data = self._commands[command] | 222 cmd_data = self._commands[command] |