diff options
| author | 2011-01-08 14:41:28 +0100 | |
|---|---|---|
| committer | 2011-04-11 19:42:19 +0200 | |
| commit | 850df2c4188541109b2d08a6b8ae2c627da21d78 (patch) | |
| tree | 3f0950c04572d3e5365afa936d39611c9461a6d7 /tools | |
| parent | 8bfed346a7b7349fe8f4d405ab5b1971ffba33c7 (diff) | |
| download | libimobiledevice-850df2c4188541109b2d08a6b8ae2c627da21d78.tar.gz libimobiledevice-850df2c4188541109b2d08a6b8ae2c627da21d78.tar.bz2 | |
idevicebackup4: improve error handling a bit
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/idevicebackup4.c | 12 |
1 files 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: | |||
| 1544 | printf("Full backup mode.\n"); | 1544 | printf("Full backup mode.\n"); |
| 1545 | else | 1545 | else |
| 1546 | printf("Incremental backup mode.\n"); | 1546 | printf("Incremental backup mode.\n"); |
| 1547 | //printf("Please wait. Device is preparing backup data...\n"); | ||
| 1548 | } else { | 1547 | } else { |
| 1549 | if (err == MOBILEBACKUP2_E_BAD_VERSION) { | 1548 | if (err == MOBILEBACKUP2_E_BAD_VERSION) { |
| 1550 | printf("ERROR: Could not start backup process: backup protocol version mismatch!\n"); | 1549 | printf("ERROR: Could not start backup process: backup protocol version mismatch!\n"); |
| @@ -1553,7 +1552,7 @@ checkpoint: | |||
| 1553 | } else { | 1552 | } else { |
| 1554 | printf("ERROR: Could not start backup process: unspecified error occured\n"); | 1553 | printf("ERROR: Could not start backup process: unspecified error occured\n"); |
| 1555 | } | 1554 | } |
| 1556 | break; | 1555 | cmd = CMD_LEAVE; |
| 1557 | } | 1556 | } |
| 1558 | break; | 1557 | break; |
| 1559 | case CMD_RESTORE: | 1558 | case CMD_RESTORE: |
| @@ -1573,6 +1572,13 @@ checkpoint: | |||
| 1573 | err = mobilebackup2_send_request(mobilebackup2, "Restore", uuid, uuid, opts); | 1572 | err = mobilebackup2_send_request(mobilebackup2, "Restore", uuid, uuid, opts); |
| 1574 | plist_free(opts); | 1573 | plist_free(opts); |
| 1575 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1574 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1575 | if (err == MOBILEBACKUP2_E_BAD_VERSION) { | ||
| 1576 | printf("ERROR: Could not start restore process: backup protocol version mismatch!\n"); | ||
| 1577 | } else if (err == MOBILEBACKUP2_E_REPLY_NOT_OK) { | ||
| 1578 | printf("ERROR: Could not start restore process: device refused to start the restore process.\n"); | ||
| 1579 | } else { | ||
| 1580 | printf("ERROR: Could not start restore process: unspecified error occured\n"); | ||
| 1581 | } | ||
| 1576 | cmd = CMD_LEAVE; | 1582 | cmd = CMD_LEAVE; |
| 1577 | } | 1583 | } |
| 1578 | break; | 1584 | break; |
| @@ -1580,6 +1586,7 @@ checkpoint: | |||
| 1580 | printf("Requesting backup info from device...\n"); | 1586 | printf("Requesting backup info from device...\n"); |
| 1581 | err = mobilebackup2_send_request(mobilebackup2, "Info", uuid, NULL, NULL); | 1587 | err = mobilebackup2_send_request(mobilebackup2, "Info", uuid, NULL, NULL); |
| 1582 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1588 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1589 | printf("Error requesting backup info from device, error code %d\n", err); | ||
| 1583 | cmd = CMD_LEAVE; | 1590 | cmd = CMD_LEAVE; |
| 1584 | } | 1591 | } |
| 1585 | break; | 1592 | break; |
| @@ -1587,6 +1594,7 @@ checkpoint: | |||
| 1587 | printf("Requesting backup list from device...\n"); | 1594 | printf("Requesting backup list from device...\n"); |
| 1588 | err = mobilebackup2_send_request(mobilebackup2, "List", uuid, NULL, NULL); | 1595 | err = mobilebackup2_send_request(mobilebackup2, "List", uuid, NULL, NULL); |
| 1589 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1596 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1597 | printf("Error requesting backup list from device, error code %d\n", err); | ||
| 1590 | cmd = CMD_LEAVE; | 1598 | cmd = CMD_LEAVE; |
| 1591 | } | 1599 | } |
| 1592 | break; | 1600 | break; |
