@@ -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 {