]> git.notmuchmail.org Git - notmuch/commit
lib/message: move xapian call inside try/catch block in _n_m_delete
authorDavid Bremner <david@tethera.net>
Sun, 4 Dec 2022 02:28:57 +0000 (22:28 -0400)
committerDavid Bremner <david@tethera.net>
Tue, 27 Dec 2022 15:59:46 +0000 (11:59 -0400)
commit1d5d0ae68689e7b1d6b974e275f19371250c4b25
tree664ff033c279c517793e32b185b13bdcc9b5df95
parent966f40086f36a5bf26d8c180cd34a01636971a84
lib/message: move xapian call inside try/catch block in _n_m_delete

The call to delete_document can throw exceptions (and can happen in
practice [1]), so catch the exception and extract the error
message. As a side effect, also move the call to _n_m_has_term inside
the try/catch. This should not change anything as that function
already traps any Xapian exceptions.

[1]: id:wwuk039sk2p.fsf@chaotikum.eu
lib/message.cc
test/T566-lib-message.sh