better error and update comments

This commit is contained in:
Steven Polley 2023-11-13 12:14:19 -07:00
parent 58d4d0ba41
commit 6436707a5d

View File

@ -9,7 +9,7 @@ import (
) )
var ( var (
configuredProviders []AccountProvider // Any providers that are successfully configured get added to this slice configuredProviders []AccountProvider // Any account providers that are successfully configured get added to this slice
ynabClient *ynab.Client // YNAB HTTP client ynabClient *ynab.Client // YNAB HTTP client
) )
@ -29,7 +29,8 @@ func init() {
} }
} }
// Loop through all providers and attempt to configure them // Loop through all account providers and attempt to configure them
// if configuration fails, the provider will not be used
configuredProviders = make([]AccountProvider, 0) configuredProviders = make([]AccountProvider, 0)
for _, p := range allProviders { for _, p := range allProviders {
err := p.Configure() err := p.Configure()
@ -60,7 +61,7 @@ func main() {
continue continue
} }
if len(balances) != len(accountIDs) { if len(balances) != len(accountIDs) {
log.Printf("mismatched balance and accountID slice lengths - expected the same: balances length = %d, accountIDs length = %d", len(balances), len(accountIDs)) log.Printf("'%s' provider data validation error: mismatched balance and accountID slice lengths - expected the same: balances length = %d, accountIDs length = %d", p.Name(), len(balances), len(accountIDs))
continue continue
} }
for i := range balances { for i := range balances {