Skip to content

Commit

Permalink
Merge pull request #193 from future-architect/fix-error-handling-in-tui
Browse files Browse the repository at this point in the history
Fix error handling in tui
  • Loading branch information
kotakanbe authored Sep 23, 2016
2 parents ac6fe6f + 093bcb7 commit 920ffe1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions report/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,28 @@ func RunTui(jsonDirName string) subcommands.ExitStatus {
var err error
scanHistory, err = selectScanHistory(jsonDirName)
if err != nil {
log.Fatal(err)
log.Errorf("%s", err)
return subcommands.ExitFailure
}

g := gocui.NewGui()
if err := g.Init(); err != nil {
log.Panicln(err)
log.Errorf("%s", err)
return subcommands.ExitFailure
}
defer g.Close()

g.SetLayout(layout)
if err := keybindings(g); err != nil {
log.Panicln(err)
log.Errorf("%s", err)
return subcommands.ExitFailure
}
g.SelBgColor = gocui.ColorGreen
g.SelFgColor = gocui.ColorBlack
g.Cursor = true

if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err)
log.Errorf("%s", err)
return subcommands.ExitFailure
}

Expand Down

0 comments on commit 920ffe1

Please sign in to comment.