v6 of nondestructive excludes

David Bremner david at tethera.net
Fri Mar 3 17:53:54 PST 2017


I decided to squash the first two patches
id:20170225160913.22844-1-david at 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 <<EOF > 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



More information about the notmuch mailing list