summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-05 10:00:26 -0300
committerDavid Bremner <david@tethera.net>2020-07-14 07:31:45 -0300
commit78e9b3467d9f09228a444bb2eec93e4c765b7e9b (patch)
tree7f63f8773e62d97f8f8b5764aca3f1386efe42e0 /lib
parentaa8e3f4487897f0c650dc37d99153099c3d3df5e (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/message.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/message.cc b/lib/message.cc
index e4848f83..5ea5aa22 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1602,8 +1602,9 @@ 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",
- private_status);
+ return COERCE_STATUS (private_status,
+ "_notmuch_message_remove_term return unexpected value: %d\n",
+ private_status);
}
if (! message->frozen)
@@ -1636,8 +1637,9 @@ 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",
- private_status);
+ return COERCE_STATUS (private_status,
+ "_notmuch_message_remove_term return unexpected value: %d\n",
+ private_status);
}
if (! message->frozen)