debug gocui.MainLoop() panic error

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-02 11:58:33 -06:00
parent d4c2f8cb1b
commit 4800fe6620
2 changed files with 5 additions and 1 deletions

View File

@ -239,7 +239,7 @@ func click(g *gocui.Gui, v *gocui.View) error {
}
if _, err := g.SetCurrentView(v.Name()); err != nil {
log.Log(NOW, "click() END err =", err)
log.Log(NOW, "click() END v.Name =", v.Name(), "err =", err)
return err
}

View File

@ -158,9 +158,13 @@ func gocuiMain() {
if err := defaultKeybindings(g); err != nil {
// normally panic here
log.Log(NOW, "defaultKeybindings(g) panic err =", err)
panic("gocuiTKdefaultkeybindings OOPS")
}
if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
log.Log(NOW, "g.MainLoop() panic err =", err)
// normally panic here
panic("gocuiTKmainloop OOPS")
}
}