aboutsummaryrefslogtreecommitdiff
path: root/selecting.go
diff options
context:
space:
mode:
Diffstat (limited to 'selecting.go')
-rw-r--r--selecting.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/selecting.go b/selecting.go
index 7eeae72..0817d3d 100644
--- a/selecting.go
+++ b/selecting.go
@@ -78,12 +78,15 @@ func (m selectingModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
cmds = append(cmds, func() tea.Msg {
items, err := getItems()
if err != nil {
- panic(err)
+ return fatalErrorMsg(err)
}
return setListItemsMsg{items}
})
+ case fatalErrorMsg:
+ fmt.Printf("encountered fatal error: %s\n", msg.Error())
+ return m, tea.Quit
}
// This will also call our delegate's update function.