- status = COERCE_STATUS (_notmuch_message_add_term (message, "file-direntry", direntry),
- "adding file-direntry term");
+ private_status = _notmuch_message_add_term (message, "file-direntry", direntry);
+ switch (private_status) {
+ case NOTMUCH_PRIVATE_STATUS_SUCCESS:
+ break;
+ case NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG:
+ _notmuch_database_log (message->notmuch, "filename too long for file-direntry term: %s\n",
+ filename);
+ return NOTMUCH_STATUS_PATH_ERROR;
+ default:
+ return COERCE_STATUS (private_status, "adding file-direntry term");
+ }
+
+ status = _notmuch_message_add_folder_terms (message, directory);