]> git.notmuchmail.org Git - notmuch/commit
lib: add notmuch_threads_status()
authorAnton Khirnov <anton@khirnov.net>
Mon, 28 Jul 2025 14:26:56 +0000 (16:26 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 4 Aug 2025 13:43:35 +0000 (10:43 -0300)
commit11d373b4fd05f5409bf5c49459fe141d2235f7f5
treebb194cb1fe5bce7696f7536e883d7acebe7cdab3
parent32af882648325ba1a24f031c0d2728b2553a5e6e
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.
lib/notmuch-private.h
lib/notmuch.h
lib/query.cc
lib/thread.cc
test/T642-database-modified-threads.sh