backups: improve errors handling
Report nice error message (not a traceback), interrupt the process on non-recoverable error (when extraction process is already dead).
This commit is contained in:
parent
f0bbb28398
commit
228ae07543
@ -742,7 +742,13 @@ def wait_backup_feedback(progress_callback, in_stream, streamproc,
|
||||
if len(buffer) <= 0:
|
||||
return ""
|
||||
|
||||
try:
|
||||
backup_target.write(buffer)
|
||||
except IOError as e:
|
||||
if e.errno == errno.EPIPE:
|
||||
run_error = "target"
|
||||
else:
|
||||
raise
|
||||
|
||||
if hmac:
|
||||
hmac.stdin.write(buffer)
|
||||
@ -1145,6 +1151,15 @@ def restore_vm_dirs (backup_source, restore_tmpdir, passphrase, vms_dirs, vms,
|
||||
while True:
|
||||
if running_backup_operation and running_backup_operation.canceled:
|
||||
break
|
||||
if not extract_proc.is_alive():
|
||||
command.terminate()
|
||||
command.wait()
|
||||
expect_tar_error = True
|
||||
if vmproc:
|
||||
vmproc.terminate()
|
||||
vmproc.wait()
|
||||
vmproc = None
|
||||
break
|
||||
if nextfile is not None:
|
||||
filename = nextfile
|
||||
else:
|
||||
|
@ -227,8 +227,11 @@ def main():
|
||||
exit (0)
|
||||
|
||||
|
||||
try:
|
||||
backup_restore_do(restore_info,
|
||||
host_collection=host_collection)
|
||||
except QubesException as e:
|
||||
print >> sys.stderr, "ERROR: %s" % str(e)
|
||||
|
||||
host_collection.unlock_db()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user