From c0b1f1a86ea968b11f1fd84c01d2bd04783b7ae5 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 17 Nov 2015 20:18:51 +0100 Subject: [PATCH] jp (file): print a message and quit if progress_id is not received --- frontends/src/jp/cmd_file.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontends/src/jp/cmd_file.py b/frontends/src/jp/cmd_file.py index 4348c386..3e586789 100644 --- a/frontends/src/jp/cmd_file.py +++ b/frontends/src/jp/cmd_file.py @@ -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)