error.go
1package common
2
3import (
4 "errors"
5
6 tea "github.com/charmbracelet/bubbletea/v2"
7)
8
9// ErrMissingRepo indicates that the requested repository could not be found.
10var ErrMissingRepo = errors.New("missing repo")
11
12// ErrorMsg is a Bubble Tea message that represents an error.
13type ErrorMsg error
14
15// ErrorCmd returns an ErrorMsg from error.
16func ErrorCmd(err error) tea.Cmd {
17 return func() tea.Msg {
18 return ErrorMsg(err)
19 }
20}