diff options
author | Glenn Vriesman <glenn.vriesman@gmail.com> | 2018-12-02 14:16:13 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-11 09:39:54 +1100 |
commit | 34fd18a395eb3dde3f6a1894d6a30c16a27f5bda (patch) | |
tree | 763bd4735b809f08c70d028912bb67da9730c70c /pkg | |
parent | a1ee11e54e1f08b0df1712a69a65a6604ae46711 (diff) |
Error handling
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/branches_panel.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 5e345091d..ce1649f64 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -106,13 +106,19 @@ func (gui *Gui) handleRebase(g *gocui.Gui, v *gocui.View) error { if selectedBranch == checkedOutBranch { return gui.createErrorPanel(g, gui.Tr.SLocalize("CantRebaseOntoSelf")) } + if err := gui.GitCommand.RebaseBranch(selectedBranch); err != nil { - if err := gui.createErrorPanel(g, "Failed to rebase"); err != nil { - gui.Log.Println(err.Error()) + if err := gui.createConfirmationPanel(g, v, "Rebase failed", "Rebasing failed, would you like to resolve it?", + func(g *gocui.Gui, v *gocui.View) error { + return nil + }, + func(g *gocui.Gui, v *gocui.View) error { + return gui.GitCommand.AbortRebaseBranch() + }); err != nil { } - return gui.GitCommand.AbortRebaseBranch() } + gui.Log.Println("Reached refresh") return gui.refreshSidePanels(g) }, nil) } |