Re: [PATCH] lib: add support for thread:<message-id> queries

Subject: Re: [PATCH] lib: add support for thread:<message-id> queries

Date: Sat, 21 Oct 2017 08:53:56 -0300

To: Jani Nikula,


From: David Bremner

Jani Nikula <> writes:

> On Tue, 17 Oct 2017, David Bremner <> wrote:
>> Jani Nikula <> writes:
>> The other field processors throw Xapian::QueryParserErrors in case bad
>> things happen (e.g. failure to read from the database). This seems to be
>> better than nothing as it allows transmitting some detail to the
>> user. See e.g. "regex error reporting" in test/ And
>> of course, speaking of tests, this should have one.
> I'm not sure what you're suggesting. Do you mean I should open-code
> notmuch_database_find_message() or notmuch_message_get_thread_id() to
> get at the exceptions thrown within them?
> BR,
> Jani.

nothing so fancy. Consider the following bit of

    status = notmuch_database_get_config (notmuch, key.c_str (), &expansion);
    if (status) {
	throw Xapian::QueryParserError ("error looking up key" + name);

That could no doubt be improved to report the specifics of `status`, but
it's already better than silently ignoring the error, as this will
eventually be reported back to library clients. I agree the exception ->
error-code -> exception -> error-code  path is pretty gross, but thats
the price we pay for mostly pretending we're not writing C++.

notmuch mailing list