On Tue, 17 Oct 2017, David Bremner <david@tethera.net> wrote: > Jani Nikula <jani@nikula.org> writes: > > >> + if (strchr (thread.c_str (), '@')) >> + notmuch_database_find_message (notmuch, thread.c_str (), &message); >> + >> + if (message) { >> + thread_id = notmuch_message_get_thread_id (message); >> + notmuch_message_destroy (message); >> + } else { >> + thread_id = thread; >> + } >> + >> + return Xapian::Query (term_prefix + thread_id); >> +} > > 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/T650-regexp-query.sh. 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. _______________________________________________ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch