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/patch_options_panel.go | |
parent | 7876cddf4a8390e9d22631e9be036c75b05f418c (diff) |
better error handling
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r-- | pkg/gui/patch_options_panel.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index c47374889..2fa274f7c 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -8,7 +8,7 @@ import ( func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error { if !gui.GitCommand.PatchManager.CommitSelected() { - return gui.createErrorPanel(gui.g, gui.Tr.SLocalize("NoPatchError")) + return gui.createErrorPanel(gui.Tr.SLocalize("NoPatchError")) } menuItems := []*menuItem{ @@ -60,7 +60,7 @@ func (gui *Gui) getPatchCommitIndex() int { func (gui *Gui) validateNormalWorkingTreeState() (bool, error) { if gui.workingTreeState() != "normal" { - return false, gui.createErrorPanel(gui.g, gui.Tr.SLocalize("CantPatchWhileRebasingError")) + return false, gui.createErrorPanel(gui.Tr.SLocalize("CantPatchWhileRebasingError")) } return true, nil } @@ -126,7 +126,7 @@ func (gui *Gui) handleApplyPatch() error { } if err := gui.GitCommand.PatchManager.ApplyPatches(false); err != nil { - return gui.createErrorPanel(gui.g, err.Error()) + return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) } |