Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2EEF4431FBF for ; Fri, 20 Nov 2009 05:01:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QxN4TavcY6+A for ; Fri, 20 Nov 2009 05:01:35 -0800 (PST) Received: from kingsolver.anholt.net (71-20-254-182.war.clearwire-wmx.net [71.20.254.182]) by olra.theworths.org (Postfix) with ESMTP id ACD0D431FAE for ; Fri, 20 Nov 2009 05:01:35 -0800 (PST) Received: from gaiman.anholt.net (localhost [127.0.0.1]) by kingsolver.anholt.net (Postfix) with ESMTP id BE85E2C9C02F; Fri, 20 Nov 2009 05:01:41 -0800 (PST) Received: by gaiman.anholt.net (Postfix, from userid 1000) id CBCFC1620D9; Fri, 20 Nov 2009 14:00:43 +0100 (CET) From: Eric Anholt To: notmuch@notmuchmail.org Date: Fri, 20 Nov 2009 14:00:42 +0100 Message-Id: <1258722042-14237-1-git-send-email-eric@anholt.net> X-Mailer: git-send-email 1.6.4.3 X-Mailman-Approved-At: Fri, 20 Nov 2009 07:47:22 -0800 Cc: Eric Anholt Subject: [notmuch] [PATCH] When a search query triggers a Xapian exception, log what the query was. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2009 13:01:36 -0000 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 --- lib/query.cc | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/query.cc b/lib/query.cc index 75f22b3..ea521dd 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -151,6 +151,7 @@ notmuch_query_search_messages (notmuch_query_t *query, } 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); } return _notmuch_messages_create (message_list); -- 1.6.4.3