mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Fixed error handling TODOs
This commit is contained in:
parent
e9fb93da7b
commit
9766f268c6
@ -34,13 +34,28 @@ func handleReply(mi interface{}) (bool, []tea.Cmd) {
|
||||
|
||||
if m.buffer != "" {
|
||||
replyToIdx, err = strconv.Atoi(m.buffer)
|
||||
|
||||
if err != nil {
|
||||
// TODO: Handle error
|
||||
cmds = append(cmds, cmd.New(
|
||||
cmd.MsgError,
|
||||
WIN_ID,
|
||||
cmd.Arg{
|
||||
Name: "error",
|
||||
Value: err,
|
||||
},
|
||||
).Tea())
|
||||
return true, cmds
|
||||
}
|
||||
|
||||
if replyToIdx >= len(m.replyIDs) {
|
||||
// TODO: Handle error
|
||||
cmds = append(cmds, cmd.New(
|
||||
cmd.MsgError,
|
||||
WIN_ID,
|
||||
cmd.Arg{
|
||||
Name: "error",
|
||||
Value: errors.New("Reply # does not exist!"),
|
||||
},
|
||||
).Tea())
|
||||
return true, cmds
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user