diff options
| author | Anton Khirnov <anton@khirnov.net> | 2025-07-28 16:26:56 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2025-08-04 10:43:35 -0300 |
| commit | 11d373b4fd05f5409bf5c49459fe141d2235f7f5 (patch) | |
| tree | bb194cb1fe5bce7696f7536e883d7acebe7cdab3 /test | |
| parent | 32af882648325ba1a24f031c0d2728b2553a5e6e (diff) | |
lib: add notmuch_threads_status()
While a number of errors can happen when iterating over threads
(DatabaseModifiedError, memory allocation errors, etc.), the API
currently cannot signal them to the caller, and either triggers an
internal error (aborting the caller) or returns NULL from
notmuch_threads_get() with no information on what actually went wrong.
Add a new public function notmuch_threads_status() - similar to
previously added notmuch_messages_status() - that allows propagating
those errors to the caller.
Use this to remove the INTERNAL_ERROR() in _notmuch_thread_create()
(triggered by T642).
Fixes: https://github.com/pazz/alot/issues/1460
Amended-By: db. Resolved whitespace disagreement between emacs and
uncrustify in favour of uncrustify.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T642-database-modified-threads.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/T642-database-modified-threads.sh b/test/T642-database-modified-threads.sh index 00bd7808..cc36a4c4 100755 --- a/test/T642-database-modified-threads.sh +++ b/test/T642-database-modified-threads.sh @@ -11,7 +11,6 @@ add_email_corpus cp -a $NOTMUCH_SRCDIR/test/corpora/lkml ${MAIL_DIR}/ test_begin_subtest "handling NOTMUCH_STATUS_OPERATION_INVALIDATED in _notmuch_thread_create" -test_subtest_known_broken test_C ${MAIL_DIR} <<EOF #include <notmuch-test.h> @@ -65,11 +64,11 @@ main (int argc, char **argv) // on the first try for (try = 0; try < 2; try++) { for (; - notmuch_threads_valid (threads); + ! notmuch_threads_status (threads); notmuch_threads_move_to_next (threads)) { notmuch_thread_t *thread = notmuch_threads_get (threads); } - status = NOTMUCH_STATUS_ITERATOR_EXHAUSTED; + status = notmuch_threads_status (threads); if (status != NOTMUCH_STATUS_OPERATION_INVALIDATED) break; |
