Instead of blowing up when the account name is missing, display a useful error message that gives the correct account names.

This commit is contained in:
Daniel Burrows 2006-12-01 11:54:25 +01:00
parent 0ee7dfd435
commit c7894a01f0

View File

@ -113,6 +113,14 @@ def startup(versionno):
syncaccounts = {}
for account in activeaccounts:
if account not in allaccounts:
if len(allaccounts) == 0:
errormsg = 'The account "%s" does not exist because no accounts are defined!'%account
else:
errormsg = 'The account "%s" does not exist. Valid accounts are:'%account
for name in allaccounts.keys():
errormsg += '\n%s'%name
ui.terminate(1, errortitle = 'Unknown Account "%s"'%account, errormsg = errormsg)
syncaccounts[account] = allaccounts[account]
server = None