lib: use COERCE_STATUS in n_m_{add,remove}_tag

Currently I don't know of a good way of testing this, but at least in
principle a Xapian exception in _notmuch_message_{add,remove}_term
would cause an abort in the library.
This commit is contained in:
David Bremner 2020-07-05 10:00:26 -03:00
parent aa8e3f4487
commit 78e9b3467d

View file

@ -1602,7 +1602,8 @@ notmuch_message_add_tag (notmuch_message_t *message, const char *tag)
private_status = _notmuch_message_add_term (message, "tag", tag);
if (private_status) {
INTERNAL_ERROR ("_notmuch_message_add_term return unexpected value: %d\n",
return COERCE_STATUS (private_status,
"_notmuch_message_remove_term return unexpected value: %d\n",
private_status);
}
@ -1636,7 +1637,8 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag)
private_status = _notmuch_message_remove_term (message, "tag", tag);
if (private_status) {
INTERNAL_ERROR ("_notmuch_message_remove_term return unexpected value: %d\n",
return COERCE_STATUS (private_status,
"_notmuch_message_remove_term return unexpected value: %d\n",
private_status);
}