return talloc_strdup (message, value.c_str ());
} catch (Xapian::Error &error) {
- _notmuch_database_log (notmuch_message_get_database (message), "A Xapian exception occurred when reading header: %s\n",
- error.get_msg ().c_str ());
- message->notmuch->exception_reported = true;
+ LOG_XAPIAN_EXCEPTION (message, error);
return NULL;
}
}
const char *
notmuch_message_get_thread_id (notmuch_message_t *message)
{
- _notmuch_message_ensure_metadata (message, message->thread_id);
+ try {
+ _notmuch_message_ensure_metadata (message, message->thread_id);
+ } catch (Xapian::Error &error) {
+ LOG_XAPIAN_EXCEPTION (message, error);
+ return NULL;
+ }
if (! message->thread_id)
INTERNAL_ERROR ("Message with document ID of %u has no thread ID.\n",
message->doc_id);