mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
compact: improve error messages on failures after compaction
The error messages written during the steps replacing old database with new now includes relevant paths and strerror.
This commit is contained in:
parent
6452ae0fcb
commit
2fd7ef64ba
1 changed files with 12 additions and 4 deletions
|
@ -942,19 +942,27 @@ notmuch_database_compact (const char *path,
|
|||
}
|
||||
|
||||
if (rename (xapian_path, backup_path)) {
|
||||
fprintf (stderr, "Error moving old database out of the way\n");
|
||||
fprintf (stderr, "Error moving %s to %s: %s\n",
|
||||
xapian_path, backup_path, strerror (errno));
|
||||
ret = NOTMUCH_STATUS_FILE_ERROR;
|
||||
goto DONE;
|
||||
}
|
||||
|
||||
if (rename (compact_xapian_path, xapian_path)) {
|
||||
fprintf (stderr, "Error moving compacted database\n");
|
||||
fprintf (stderr, "Error moving %s to %s: %s\n",
|
||||
compact_xapian_path, xapian_path, strerror (errno));
|
||||
ret = NOTMUCH_STATUS_FILE_ERROR;
|
||||
goto DONE;
|
||||
}
|
||||
|
||||
if (! keep_backup)
|
||||
rmtree (backup_path);
|
||||
if (! keep_backup) {
|
||||
if (rmtree (backup_path)) {
|
||||
fprintf (stderr, "Error removing old database %s: %s\n",
|
||||
backup_path, strerror (errno));
|
||||
ret = NOTMUCH_STATUS_FILE_ERROR;
|
||||
goto DONE;
|
||||
}
|
||||
}
|
||||
|
||||
DONE:
|
||||
if (notmuch)
|
||||
|
|
Loading…
Reference in a new issue