1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Fixed error handling TODOs

This commit is contained in:
マリウス 2023-01-05 00:25:20 -05:00
parent e9fb93da7b
commit 9766f268c6
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

View File

@ -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
}
}