This will require some care for the caller to check the sign, and not
just add error returns into a running total.
int
notmuch_message_count_files (notmuch_message_t *message)
{
- _notmuch_message_ensure_filename_list (message);
+ try {
+ _notmuch_message_ensure_filename_list (message);
+ } catch (Xapian::Error &error) {
+ LOG_XAPIAN_EXCEPTION (message, error);
+ return -1;
+ }
return _notmuch_string_list_length (message->filename_list);
}
/**
* Get the total number of files associated with a message.
- * @returns Non-negative integer
+ * @returns Non-negative integer for file count.
+ * @returns Negative integer for error.
* @since libnotmuch 5.0 (notmuch 0.25)
*/
int
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "Handle counting files from closed database"
-test_subtest_known_broken
cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
int result;