Skip to content

Commit

Permalink
do not create error panel for sentinel errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield authored and github-actions[bot] committed Aug 25, 2020
1 parent afd6691 commit 45a0378
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/gui/confirmation_panel.go
Expand Up @@ -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())
}
9 changes: 9 additions & 0 deletions pkg/gui/gui.go
Expand Up @@ -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

Expand Down

0 comments on commit 45a0378

Please sign in to comment.