aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit 45b4c8a72474d38d0fcba342758b44d9238c76de
parent 78db7ccafaeb971871ddf60511a50143491ca1d2
Author: Julian P Samaroo <jpsamaroo@jpsamaroo.me>
Date:   Sat, 30 Mar 2019 15:23:14 -0500

Handle no configured accounts gracefully

Instead of throwing a runtime error, when no accounts are configured in
accounts.conf, we provide an informative error message.

Diffstat:
Mconfig/config.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/config/config.go b/config/config.go @@ -93,6 +93,10 @@ func loadAccountConfig(path string) ([]AccountConfig, error) { } accounts = append(accounts, account) } + if len(accounts) == 0 { + err = errors.New("No accounts configured in accounts.conf") + return nil, err + } return accounts, nil }