When a search query triggers a Xapian exception, log what the query was.

In my script containing a series of queries to be run on new mail for
setting up tags, it's nice to see which query I typed wrong.

Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2009-11-20 14:00:42 +01:00 committed by Carl Worth
parent a8e0d4f25f
commit 59c241ebd0

View file

@ -151,6 +151,7 @@ notmuch_query_search_messages (notmuch_query_t *query,
} catch (const Xapian::Error &error) { } catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred: %s\n", fprintf (stderr, "A Xapian exception occurred: %s\n",
error.get_msg().c_str()); error.get_msg().c_str());
fprintf (stderr, "Query string was: %s\n", query->query_string);
} }
return _notmuch_messages_create (message_list); return _notmuch_messages_create (message_list);