]> git.cworth.org Git - notmuch/commitdiff
CLI/new: check status of notmuch_message_maildir_flags_to_tags
authorDavid Bremner <david@tethera.net>
Sat, 8 May 2021 23:03:28 +0000 (20:03 -0300)
committerDavid Bremner <david@tethera.net>
Wed, 19 May 2021 12:00:08 +0000 (09:00 -0300)
This improves error reporting since it prints the specifics of the exception.

notmuch-new.c

index 1162e25a1273975c7a9c77473f5e6299e23fbc13..1ee498faaf7c4f79a174adab84c033cb3a8b2fd9 100644 (file)
@@ -403,8 +403,11 @@ add_file (notmuch_database_t *notmuch, const char *filename,
        break;
     /* Non-fatal issues (go on to next file). */
     case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID:
-       if (state->synchronize_flags)
-           notmuch_message_maildir_flags_to_tags (message);
+       if (state->synchronize_flags) {
+           status = notmuch_message_maildir_flags_to_tags (message);
+           if (print_status_message ("add_file", message, status))
+               goto DONE;
+       }
        break;
     case NOTMUCH_STATUS_FILE_NOT_EMAIL:
        fprintf (stderr, "Note: Ignoring non-mail file: %s\n", filename);