mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-01 15:10:44 +00:00
common: update Errors type (#1129)
* common: adjust common error slice to allow multi errors.Is matching and conform to interface better * zb: forgot to save? * linties: fixies * linties: word change as well. * nitters: glorious * buts * nitters: fix glorious bug * Update common/common.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * nitters: shifty --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -237,10 +237,10 @@ func (s *Service) Update(incoming *Holdings, creds *Credentials) error {
|
||||
s.exchangeAccounts[exch] = accounts
|
||||
}
|
||||
|
||||
var errs common.Errors
|
||||
var errs error
|
||||
for x := range incoming.Accounts {
|
||||
if !incoming.Accounts[x].AssetType.IsValid() {
|
||||
errs = append(errs, fmt.Errorf("cannot load sub account holdings for %s [%s] %w",
|
||||
errs = common.AppendError(errs, fmt.Errorf("cannot load sub account holdings for %s [%s] %w",
|
||||
incoming.Accounts[x].ID,
|
||||
incoming.Accounts[x].AssetType,
|
||||
asset.ErrNotSupported))
|
||||
@@ -295,11 +295,7 @@ func (s *Service) Update(incoming *Holdings, creds *Credentials) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if errs != nil {
|
||||
return errs
|
||||
}
|
||||
|
||||
return nil
|
||||
return errs
|
||||
}
|
||||
|
||||
// load checks to see if there is a change from incoming balance, if there is a
|
||||
|
||||
Reference in New Issue
Block a user