Provide the user with instructions after we fail to move the old
un-compacted database out of the way.

Signed-off-by: Ben Gamari <bgamari.f...@gmail.com>
---
 lib/database.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 06f1c0a..57c2292 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -922,7 +922,14 @@ notmuch_database_compact (const char* path,
 
     if (old_xapian_path != NULL) {
        if (rename(xapian_path, old_xapian_path)) {
-           fprintf (stderr, "Error moving old database out of the way\n");
+           fprintf (stderr, "Error moving old database out of the way: %s\n",
+                    strerror(errno));
+           fprintf (stderr, "\n");
+           fprintf (stderr, "Old database: %s\n", xapian_path);
+           fprintf (stderr, "Compacted database: %s\n", compact_xapian_path);
+           fprintf (stderr, "\n");
+           fprintf (stderr, "At this point it's probably best to remove the 
compacted database,\n");
+           fprintf (stderr, "find the cause of this error, and try compacting 
again.\n");
            ret = NOTMUCH_STATUS_FILE_ERROR;
            goto DONE;
        }
-- 
1.8.3.2

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to