From 8ada3260ab8c3e9b4981c4bdc2de01aff2fae88c Mon Sep 17 00:00:00 2001 From: Jose Lombera Date: Wed, 31 Aug 2022 21:21:01 -0500 Subject: notmuch: fix regression in error handling Fix reggression introduced by 70bfcfef4257 ("lint: work nicely with wrapped errors (errorlint)"). Discovered this because it broke my arec-notmuch config where I have `exclude-tags=deleted`. Queries with `tag:deleted` would now fail with error message saying "Argument was ignored". Fixes: 70bfcfef4257 ("lint: work nicely with wrapped errors (errorlint)") Signed-off-by: Jose Lombera Acked-by: Robin Jarry --- worker/notmuch/lib/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'worker/notmuch') diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go index 007a0a7e..1add2770 100644 --- a/worker/notmuch/lib/database.go +++ b/worker/notmuch/lib/database.go @@ -113,7 +113,7 @@ func (db *DB) newQuery(ndb *notmuch.DB, query string) (*notmuch.Query, error) { q.SetSortScheme(notmuch.SORT_OLDEST_FIRST) for _, t := range db.excludedTags { err := q.AddTagExclude(t) - if errors.Is(err, notmuch.ErrIgnored) { + if err != nil && !errors.Is(err, notmuch.ErrIgnored) { return nil, err } } -- cgit