]> git.notmuchmail.org Git - notmuch/commitdiff
cli/new: improve error reporting
authorDavid Bremner <david@tethera.net>
Sat, 15 Jul 2017 02:01:26 +0000 (23:01 -0300)
committerDavid Bremner <david@tethera.net>
Thu, 17 Aug 2017 00:38:54 +0000 (21:38 -0300)
Recently a user reported a crash in notmuch new, but because of
missing error reporting, all they could say was "A Xapian exception
occured". This commit adds the extra information available about
the error message in the exception.

notmuch-new.c

index 3a60f7cae47fee568d8002f5db178b6ea7587d7a..16b4d0225a649264c4931aba540be2b072842783 100644 (file)
@@ -291,8 +291,7 @@ add_file (notmuch_database_t *notmuch, const char *filename,
     case NOTMUCH_STATUS_READ_ONLY_DATABASE:
     case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
     case NOTMUCH_STATUS_OUT_OF_MEMORY:
-       fprintf (stderr, "Error: %s. Halting processing.\n",
-                notmuch_status_to_string (status));
+       (void) print_status_database("add_file", notmuch, status);
        goto DONE;
     default:
        INTERNAL_ERROR ("add_message returned unexpected value: %d", status);