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:
parent
78db7ccafa
commit
45b4c8a724
|
@ -93,6 +93,10 @@ func loadAccountConfig(path string) ([]AccountConfig, error) {
|
||||||
}
|
}
|
||||||
accounts = append(accounts, account)
|
accounts = append(accounts, account)
|
||||||
}
|
}
|
||||||
|
if len(accounts) == 0 {
|
||||||
|
err = errors.New("No accounts configured in accounts.conf")
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return accounts, nil
|
return accounts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue