#define LOG_XAPIAN_EXCEPTION(message, error) _log_xapian_exception (__location__, message, error)
static void
-_log_xapian_exception (const char *where, notmuch_message_t *message, const Xapian::Error error) {
+_log_xapian_exception (const char *where, notmuch_message_t *message, const Xapian::Error error)
+{
notmuch_database_t *notmuch = notmuch_message_get_database (message);
+
_notmuch_database_log (notmuch,
"A Xapian exception occurred at %s: %s\n",
where,
doc_id = _notmuch_database_generate_doc_id (notmuch);
} catch (const Xapian::Error &error) {
- _notmuch_database_log (notmuch_message_get_database (message), "A Xapian exception occurred creating message: %s\n",
+ _notmuch_database_log (notmuch_message_get_database (message),
+ "A Xapian exception occurred creating message: %s\n",
error.get_msg ().c_str ());
notmuch->exception_reported = true;
*status_ret = NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
return NULL;
const std::string &term = *i;
+
if (strncmp (term.c_str (), prefix, prefix_len))
return NULL;
/* all the way without an exception */
break;
} catch (const Xapian::DatabaseModifiedError &error) {
- notmuch_status_t status = _notmuch_database_reopen (message->notmuch);
+ notmuch_status_t status = notmuch_database_reopen (message->notmuch,
+ NOTMUCH_DATABASE_MODE_READ_ONLY);
if (status != NOTMUCH_STATUS_SUCCESS)
INTERNAL_ERROR ("unhandled error from notmuch_database_reopen: %s\n",
notmuch_status_to_string (status));
{
notmuch_status_t status;
notmuch_bool_t ret;
+
status = notmuch_message_has_maildir_flag_st (message, flag, &ret);
if (status)
return FALSE;
notmuch_bool_t *is_set)
{
notmuch_status_t status;
-
+
if (! is_set)
return NOTMUCH_STATUS_NULL_POINTER;
status = _ensure_maildir_flags (message, false);
if (status)
return status;
-
+
*is_set = message->maildir_flags && (strchr (message->maildir_flags, flag) != NULL);
return NOTMUCH_STATUS_SUCCESS;
}
private_status = _notmuch_message_remove_term (message, "tag", tag);
if (private_status) {
return COERCE_STATUS (private_status,
- "_notmuch_message_remove_term return unexpected value: %d\n",
- private_status);
+ "_notmuch_message_remove_term return unexpected value: %d\n",
+ private_status);
}
}
orig_thread_id = notmuch_message_get_thread_id (message);
if (! orig_thread_id) {
/* the following is correct as long as there is only one reason
- n_m_get_thread_id returns NULL
- */
+ * n_m_get_thread_id returns NULL
+ */
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}