diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-29 22:31:54 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-04 21:57:57 +0200 |
commit | 5ca6022d007bc83daba1e7297480d37f56554455 (patch) | |
tree | cc592d08276b7f0c8db6a4280bb7fb648b2548fe /worker/notmuch/lib/database.go | |
parent | a8d631177f4315810f0ab7c7d66d38e332ab0916 (diff) | |
download | aerc-5ca6022d007bc83daba1e7297480d37f56554455.tar.gz |
lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/notmuch/lib/database.go')
-rw-r--r-- | worker/notmuch/lib/database.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go index ac1a28ed..780e7ab3 100644 --- a/worker/notmuch/lib/database.go +++ b/worker/notmuch/lib/database.go @@ -234,7 +234,11 @@ func (db *DB) msgModify(key string, } defer msg.Close() - cb(msg) + err = cb(msg) + if err != nil { + logging.Warnf("callback failed: %v", err) + } + err = msg.TagsToMaildirFlags() if err != nil { logging.Errorf("could not sync maildir flags: %v", err) @@ -248,10 +252,16 @@ func (db *DB) MsgModifyTags(key string, add, remove []string) error { err := db.msgModify(key, func(msg *notmuch.Message) error { ierr := msg.Atomic(func(msg *notmuch.Message) { for _, t := range add { - msg.AddTag(t) + err := msg.AddTag(t) + if err != nil { + logging.Warnf("failed to add tag: %v", err) + } } for _, t := range remove { - msg.RemoveTag(t) + err := msg.RemoveTag(t) + if err != nil { + logging.Warnf("failed to add tag: %v", err) + } } }) return ierr |