1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +02:00

do not create error panel for sentinel errors

This commit is contained in:
Jesse Duffield 2020-08-26 08:20:33 +10:00 committed by github-actions[bot]
parent afd669194a
commit 45a0378c01
2 changed files with 15 additions and 0 deletions

View File

@ -244,5 +244,11 @@ func (gui *Gui) createErrorPanel(message string) error {
}
func (gui *Gui) surfaceError(err error) error {
for _, sentinelError := range gui.sentinelErrorsArr() {
if err == sentinelError {
return err
}
}
return gui.createErrorPanel(err.Error())
}

View File

@ -72,6 +72,15 @@ func (gui *Gui) GenerateSentinelErrors() {
}
}
func (gui *Gui) sentinelErrorsArr() []error {
return []error{
gui.Errors.ErrSubProcess,
gui.Errors.ErrNoFiles,
gui.Errors.ErrSwitchRepo,
gui.Errors.ErrRestart,
}
}
// Teml is short for template used to make the required map[string]interface{} shorter when using gui.Tr.SLocalize and gui.Tr.TemplateLocalize
type Teml i18n.Teml