1
0
mirror of https://git.sr.ht/~sircmpwn/aerc synced 2024-11-23 16:42:07 +01:00

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.
This commit is contained in:
Julian P Samaroo 2019-03-30 15:23:14 -05:00 committed by Drew DeVault
parent 78db7ccafa
commit 45b4c8a724

@ -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
}