return NOTMUCH_STATUS_SUCCESS;
} catch (const Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred performing query: %s\n",
- error.get_msg().c_str());
- fprintf (stderr, "Query string was: %s\n", query->query_string);
+ _notmuch_database_log (notmuch,
+ "A Xapian exception occurred performing query: %s\n"
+ "Query string was: %s\n",
+ error.get_msg().c_str(),
+ query->query_string);
+
notmuch->exception_reported = TRUE;
talloc_free (messages);
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
count = mset.get_matches_estimated();
} catch (const Xapian::Error &error) {
- fprintf (stderr, "A Xapian exception occurred: %s\n",
- error.get_msg().c_str());
- fprintf (stderr, "Query string was: %s\n", query->query_string);
+ _notmuch_database_log (notmuch,
+ "A Xapian exception occurred performing query: %s\n"
+ "Query string was: %s\n",
+ error.get_msg().c_str(),
+ query->query_string);
+
}
return count;
GHashTable *hash;
unsigned int count;
notmuch_sort_t sort;
+ notmuch_status_t status;
sort = query->sort;
query->sort = NOTMUCH_SORT_UNSORTED;
- messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (status)
+ return 0;
+
query->sort = sort;
if (messages == NULL)
return 0;
return count;
}
+
+notmuch_database_t *
+notmuch_query_get_database (notmuch_query_t *query)
+{
+ return query->notmuch;
+}