From 850df2c4188541109b2d08a6b8ae2c627da21d78 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 8 Jan 2011 14:41:28 +0100 Subject: idevicebackup4: improve error handling a bit --- tools/idevicebackup4.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/idevicebackup4.c b/tools/idevicebackup4.c index 519b511..af798c0 100644 --- a/tools/idevicebackup4.c +++ b/tools/idevicebackup4.c @@ -1544,7 +1544,6 @@ checkpoint: printf("Full backup mode.\n"); else printf("Incremental backup mode.\n"); - //printf("Please wait. Device is preparing backup data...\n"); } else { if (err == MOBILEBACKUP2_E_BAD_VERSION) { printf("ERROR: Could not start backup process: backup protocol version mismatch!\n"); @@ -1553,7 +1552,7 @@ checkpoint: } else { printf("ERROR: Could not start backup process: unspecified error occured\n"); } - break; + cmd = CMD_LEAVE; } break; case CMD_RESTORE: @@ -1573,6 +1572,13 @@ checkpoint: err = mobilebackup2_send_request(mobilebackup2, "Restore", uuid, uuid, opts); plist_free(opts); if (err != MOBILEBACKUP2_E_SUCCESS) { + if (err == MOBILEBACKUP2_E_BAD_VERSION) { + printf("ERROR: Could not start restore process: backup protocol version mismatch!\n"); + } else if (err == MOBILEBACKUP2_E_REPLY_NOT_OK) { + printf("ERROR: Could not start restore process: device refused to start the restore process.\n"); + } else { + printf("ERROR: Could not start restore process: unspecified error occured\n"); + } cmd = CMD_LEAVE; } break; @@ -1580,6 +1586,7 @@ checkpoint: printf("Requesting backup info from device...\n"); err = mobilebackup2_send_request(mobilebackup2, "Info", uuid, NULL, NULL); if (err != MOBILEBACKUP2_E_SUCCESS) { + printf("Error requesting backup info from device, error code %d\n", err); cmd = CMD_LEAVE; } break; @@ -1587,6 +1594,7 @@ checkpoint: printf("Requesting backup list from device...\n"); err = mobilebackup2_send_request(mobilebackup2, "List", uuid, NULL, NULL); if (err != MOBILEBACKUP2_E_SUCCESS) { + printf("Error requesting backup list from device, error code %d\n", err); cmd = CMD_LEAVE; } break; -- cgit v1.1-32-gdbae