aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch
diff options
context:
space:
mode:
Diffstat (limited to 'worker/notmuch')
-rw-r--r--worker/notmuch/lib/database.go16
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