forked from Mirrors/bubbletea
convenience function for creating an ErrMsg from an error
This commit is contained in:
parent
e1d4a14345
commit
524cf2cffd
6
tea.go
6
tea.go
|
@ -59,6 +59,12 @@ func NewErrMsg(s string) ErrMsg {
|
||||||
return ErrMsg{errors.New(s)}
|
return ErrMsg{errors.New(s)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewErrMsgFromErr is a convenience function for creating an ErrMsg from an
|
||||||
|
// existing error
|
||||||
|
func NewErrMsgFromErr(e error) ErrMsg {
|
||||||
|
return ErrMsg{e}
|
||||||
|
}
|
||||||
|
|
||||||
// Quit is a command that tells the program to exit
|
// Quit is a command that tells the program to exit
|
||||||
func Quit(_ Model) Msg {
|
func Quit(_ Model) Msg {
|
||||||
return quitMsg{}
|
return quitMsg{}
|
||||||
|
|
Loading…
Reference in New Issue