- /* Xapian exceptions are not handled properly.
- * (function may return 0 after printing a message)
- * Thus there is nothing we can do here...
- */
- return UINT2NUM(notmuch_query_count_messages(query));
+ status = notmuch_query_count_messages (query, &count);
+ if (status)
+ notmuch_rb_status_raise (status);
+
+ return UINT2NUM(count);