diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-26 08:20:33 +1000 |
---|---|---|
committer | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2020-08-25 22:21:15 +0000 |
commit | 45a0378c01236af91451a1fbf14aa2e65561200b (patch) | |
tree | 0998b309006db57877c5a261bf62de337070ebd4 | |
parent | afd669194ad73f85e21d5dfd6d8f0ec26286ca5e (diff) |
do not create error panel for sentinel errorsv0.22.1
-rw-r--r-- | pkg/gui/confirmation_panel.go | 6 | ||||
-rw-r--r-- | pkg/gui/gui.go | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index ed8a0137f..103b6a084 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -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()) } diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 12d680ab9..e95ef1e99 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -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 |