jp (file): print a message and quit if progress_id is not received

This commit is contained in:
Goffi 2015-11-17 20:18:51 +01:00
commit c0b1f1a86e

View file

@ -59,7 +59,12 @@ class Send(base.CommandBase):
"""
#FIXME: this show progress only for last progress_id
self.disp(_(u"File request sent to {jid}".format(jid=self.full_dest_jid)), 1)
self.progress_id = data['progress']
try:
self.progress_id = data['progress']
except KeyError:
# TODO: if 'xmlui' key is present, manage xmlui message display
self.disp(_(u"Can't send file to {jid}".format(jid=self.full_dest_jid)), error=True)
self.host.quit(2)
def error(self, failure):
self.disp(_("Error while trying to send a file: {reason}").format(reason=failure), error=True)