From 883660dbbff06b28b2d55d35894df8693e990723 Mon Sep 17 00:00:00 2001 From: isabel Date: Mon, 27 May 2024 22:15:30 +0100 Subject: [PATCH] feat: error checking --- cmd/keys.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/keys.go b/cmd/keys.go index 85ce108..59e5d6b 100644 --- a/cmd/keys.go +++ b/cmd/keys.go @@ -182,7 +182,10 @@ func (m Model) handleKeys(msg tea.KeyMsg) (Model, tea.Cmd) { lib.ToggleRead(m.feeds, m.feed.ID, m.table.Cursor()) m = m.loadContent(m.feed.ID) } - m.feeds.WriteTracking() + err := m.feeds.WriteTracking() + if err != nil { + log.Fatalf("Could not write tracking data: %s", err) + } case key.Matches(msg, m.keys.ReadAll): switch m.context { @@ -197,7 +200,10 @@ func (m Model) handleKeys(msg tea.KeyMsg) (Model, tea.Cmd) { m = m.loadHome() } - m.feeds.WriteTracking() + err := m.feeds.WriteTracking() + if err != nil { + log.Fatalf("Could not write tracking data: %s", err) + } } return m, nil