Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
glvr182 authored and jesseduffield committed Dec 10, 2018
1 parent a1ee11e commit 34fd18a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/gui/branches_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 34fd18a

Please sign in to comment.