1
0

Do not ignore errors

This commit is contained in:
Michal Horejsek
2020-09-03 14:36:12 +02:00
parent 9218598140
commit bb1d27a5be
9 changed files with 63 additions and 22 deletions

View File

@ -45,7 +45,9 @@ func (c *Cache) getEventID(userID string) string {
c.lock.Lock()
defer c.lock.Unlock()
_ = c.loadCache()
if err := c.loadCache(); err != nil {
log.WithError(err).Warn("Problem to load store cache")
}
if c.cache == nil {
c.cache = map[string]map[string]string{}

View File

@ -41,7 +41,7 @@ type Mailbox struct {
}
func newMailbox(storeAddress *Address, labelID, labelPrefix, labelName, color string) (mb *Mailbox, err error) {
_ = storeAddress.store.db.Update(func(tx *bolt.Tx) error {
err = storeAddress.store.db.Update(func(tx *bolt.Tx) error {
mb, err = txNewMailbox(tx, storeAddress, labelID, labelPrefix, labelName, color)
return err
})

View File

@ -129,6 +129,9 @@ func (storeMailbox *Mailbox) MarkMessagesRead(apiIDs []string) error {
ids = append(ids, apiID)
}
}
if len(ids) == 0 {
return nil
}
return storeMailbox.client().MarkMessagesRead(ids)
}

View File

@ -218,7 +218,9 @@ func (store *Store) deleteMailboxEvent(labelID string) error {
store.lock.Lock()
defer store.lock.Unlock()
_ = store.removeMailboxCount(labelID)
if err := store.removeMailboxCount(labelID); err != nil {
log.WithError(err).Warn("Problem to remove mailbox counts while deleting mailbox")
}
for _, a := range store.addresses {
if err := a.deleteMailboxEvent(labelID); err != nil {