From 15c9b9308d353d558f7c4fc2fe03012afc84be40 Mon Sep 17 00:00:00 2001 From: Aria Date: Fri, 3 Feb 2023 15:48:00 +0000 Subject: better error handling --- confirm.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'confirm.go') diff --git a/confirm.go b/confirm.go index a7d4748..31ce746 100644 --- a/confirm.go +++ b/confirm.go @@ -82,6 +82,9 @@ func (m confirmModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.viewport.Width = msg.Width - padding_h m.viewport.Height = msg.Height - verticalMarginHeight - padding_v } + case fatalErrorMsg: + fmt.Printf("encountered fatal error: %s\n", msg.Error()) + return m, tea.Quit } // Handle keyboard and mouse events in the viewport -- cgit v1.2.3