jp (file): print a message and quit if progress_id is not received
This commit is contained in:
parent
51aecd012a
commit
c0b1f1a86e
1 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue