From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CC7DB6DE1CD1 for ; Fri, 3 Mar 2017 17:54:04 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C0JtZOBAcfLI for ; Fri, 3 Mar 2017 17:54:03 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 9B9426DE1BEB for ; Fri, 3 Mar 2017 17:54:03 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cjyss-0001Gd-8i for notmuch@notmuchmail.org; Fri, 03 Mar 2017 20:53:22 -0500 Received: (nullmailer pid 3743 invoked by uid 1000); Sat, 04 Mar 2017 01:54:00 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: v6 of nondestructive excludes Date: Fri, 3 Mar 2017 21:53:54 -0400 Message-Id: <20170304015356.3684-1-david@tethera.net> X-Mailer: git-send-email 2.11.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sat, 04 Mar 2017 01:54:04 -0000 I decided to squash the first two patches id:20170225160913.22844-1-david@tethera.net together to avoid temporarily marking a test broken. Otherwise the net changes are pretty minimal since the last version. diff --git a/lib/query.cc b/lib/query.cc index 2c6a4ba6..59e9141a 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -137,13 +137,15 @@ _notmuch_query_ensure_parsed (notmuch_query_t *query) query->parsed = TRUE; } catch (const Xapian::Error &error) { - _notmuch_database_log (query->notmuch, - "A Xapian exception occured parsing query: %s\n", - error.get_msg().c_str()); - _notmuch_database_log_append (query->notmuch, - "Query string was: %s\n", - query->query_string); - query->notmuch->exception_reported = TRUE; + if (!query->notmuch->exception_reported) { + _notmuch_database_log (query->notmuch, + "A Xapian exception occurred parsing query: %s\n", + error.get_msg ().c_str ()); + _notmuch_database_log_append (query->notmuch, + "Query string was: %s\n", + query->query_string); + query->notmuch->exception_reported = TRUE; + } return NOTMUCH_STATUS_XAPIAN_EXCEPTION; } diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh index a8039610..df48ab82 100755 --- a/test/T650-regexp-query.sh +++ b/test/T650-regexp-query.sh @@ -74,7 +74,7 @@ test_begin_subtest "regexp error reporting" notmuch search 'from:/unbalanced[/' 1>OUTPUT 2>&1 cat < EXPECTED notmuch search: A Xapian exception occurred -A Xapian exception occurred performing query: Invalid regular expression +A Xapian exception occurred parsing query: Invalid regular expression Query string was: from:/unbalanced[/ EOF test_expect_equal_file EXPECTED OUTPUT