lib: catch Xapian exceptions in n_m_remove_tag

The churn here is again mainly re-indentation.
This commit is contained in:
David Bremner 2020-07-05 10:00:25 -03:00
parent 0fc769aa4f
commit aa8e3f4487
2 changed files with 19 additions and 15 deletions

View file

@ -1623,6 +1623,7 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag)
notmuch_private_status_t private_status;
notmuch_status_t status;
try {
status = _notmuch_database_ensure_writable (message->notmuch);
if (status)
return status;
@ -1641,6 +1642,10 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag)
if (! message->frozen)
_notmuch_message_sync (message);
} catch (Xapian::Error &error) {
LOG_XAPIAN_EXCEPTION (message, error);
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
return NOTMUCH_STATUS_SUCCESS;
}

View file

@ -519,7 +519,6 @@ EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "Handle removing tag with closed database"
test_subtest_known_broken
cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_status_t status;