summaryrefslogtreecommitdiffstats
path: root/pkg/gui/patch_options_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-28 11:47:54 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-28 11:59:45 +1100
commit814ee24c8d13ae554925530ec68f325394ddfe6d (patch)
treed4713ad9927e84ad043b640165d132fcc6113dca /pkg/gui/patch_options_panel.go
parent7876cddf4a8390e9d22631e9be036c75b05f418c (diff)
better error handling
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r--pkg/gui/patch_options_panel.go6
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})
}