]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-dump.c
notmuch.Database.remove_message should raise exception on failure
[notmuch] / notmuch-dump.c
index fab22bdd6bcfe7f1b0ca26e433001d49e416c4ab..829781f8b44feba2f76fb4e39427c5f1029b7fd1 100644 (file)
@@ -48,8 +48,13 @@ database_dump_file (notmuch_database_t *notmuch, gzFile output,
 
     char *buffer = NULL;
     size_t buffer_size = 0;
+    notmuch_status_t status;
 
-    for (messages = notmuch_query_search_messages (query);
+    status = notmuch_query_search_messages_st (query, &messages);
+    if (print_status_query ("notmuch dump", query, status))
+       return EXIT_FAILURE;
+
+    for (;
         notmuch_messages_valid (messages);
         notmuch_messages_move_to_next (messages)) {
        int first = 1;
@@ -215,6 +220,8 @@ notmuch_dump_command (notmuch_config_t *config, int argc, char *argv[])
                               NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch))
        return EXIT_FAILURE;
 
+    notmuch_exit_if_unmatched_db_uuid (notmuch);
+
     char *output_file_name = NULL;
     int opt_index;