diff --git a/main.go b/main.go index 4462c38f7c3567c6f9eeb186a9d7bda594ec64df..ad0d8537c06f74bd453cd7388662aae1fc70da0d 100644 --- a/main.go +++ b/main.go @@ -733,12 +733,17 @@ func (m *mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { Inline: a.Inline, }) } - go config.SaveEmailBody(folderName, config.CachedEmailBody{ - UID: msg.UID, - AccountID: msg.AccountID, - Body: msg.Body, - Attachments: cachedAttachments, - }) + go func() { + err := config.SaveEmailBody(folderName, config.CachedEmailBody{ + UID: msg.UID, + AccountID: msg.AccountID, + Body: msg.Body, + Attachments: cachedAttachments, + }) + if err != nil { + log.Printf("debug: error caching email body fails (disk full, permission denied) for UID: %d: %v", msg.UID, err) + } + }() } // Forward to FolderInbox for rendering if m.folderInbox != nil { @@ -1260,13 +1265,17 @@ func (m *mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } cachedAttachments = append(cachedAttachments, ca) } - _ = config.SaveEmailBody(folderForCache, config.CachedEmailBody{ + err := config.SaveEmailBody(folderForCache, config.CachedEmailBody{ UID: msg.UID, AccountID: msg.AccountID, Body: msg.Body, Attachments: cachedAttachments, }) + if err != nil { + log.Printf("debug: error caching email body fails (disk full, permission denied) for UID: %d: %v", msg.UID, err) + } + email := m.getEmailByUIDAndAccount(msg.UID, msg.AccountID, msg.Mailbox) if email == nil { if m.folderInbox != nil {