From 2d7a8707257eec2b9f0ff41772cfd8dab4f1201e Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 8 Aug 2020 11:38:38 +0200 Subject: show error if account view creation fails This can happen for example if aerc is compiled without notmuch support but the notmuch worker is requested. Pushing a status message isn't good enough, as this gets overridden pretty quickly if one has multiple accounts configured. So we show a fullscreen error instead. --- widgets/account-wizard.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'widgets/account-wizard.go') diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index 59f22e7..f47e97e 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -534,8 +534,13 @@ func (wizard *AccountWizard) finish(tutorial bool) { } wizard.conf.Accounts = append(wizard.conf.Accounts, account) - view := NewAccountView(wizard.aerc, wizard.conf, &account, + view, err := NewAccountView(wizard.aerc, wizard.conf, &account, wizard.aerc.logger, wizard.aerc) + if err != nil { + wizard.aerc.NewTab(errorScreen(err.Error(), wizard.conf.Ui), + account.Name) + return + } wizard.aerc.accounts[account.Name] = view wizard.aerc.NewTab(view, account.Name) -- cgit v1.2.3