diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:47:54 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:59:45 +1100 |
commit | 814ee24c8d13ae554925530ec68f325394ddfe6d (patch) | |
tree | d4713ad9927e84ad043b640165d132fcc6113dca /pkg/gui/workspace_reset_options_panel.go | |
parent | 7876cddf4a8390e9d22631e9be036c75b05f418c (diff) |
better error handling
Diffstat (limited to 'pkg/gui/workspace_reset_options_panel.go')
-rw-r--r-- | pkg/gui/workspace_reset_options_panel.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/gui/workspace_reset_options_panel.go b/pkg/gui/workspace_reset_options_panel.go index 37928c0aa..0899b5c98 100644 --- a/pkg/gui/workspace_reset_options_panel.go +++ b/pkg/gui/workspace_reset_options_panel.go @@ -16,7 +16,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.ResetAndClean(); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) @@ -29,7 +29,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.DiscardAnyUnstagedFileChanges(); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) @@ -42,7 +42,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.RemoveUntrackedFiles(); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) @@ -55,7 +55,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.ResetSoft("HEAD"); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) @@ -68,7 +68,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.ResetSoft("HEAD"); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) @@ -81,7 +81,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, onPress: func() error { if err := gui.GitCommand.ResetHard("HEAD"); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{FILES}}) |