notmuch: fix regression in error handling

Fix reggression introduced by 70bfcfef42 ("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: 70bfcfef42 ("lint: work nicely with wrapped errors (errorlint)")
Signed-off-by: Jose Lombera <jose@lombera.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Jose Lombera 2022-08-31 21:21:01 -05:00 committed by Robin Jarry
parent dcd397f776
commit 8ada3260ab

View file

@ -113,7 +113,7 @@ func (db *DB) newQuery(ndb *notmuch.DB, query string) (*notmuch.Query, error) {
q.SetSortScheme(notmuch.SORT_OLDEST_FIRST) q.SetSortScheme(notmuch.SORT_OLDEST_FIRST)
for _, t := range db.excludedTags { for _, t := range db.excludedTags {
err := q.AddTagExclude(t) err := q.AddTagExclude(t)
if errors.Is(err, notmuch.ErrIgnored) { if err != nil && !errors.Is(err, notmuch.ErrIgnored) {
return nil, err return nil, err
} }
} }