Skip to content

Commit

Permalink
fix_: properly wrap error
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin committed Dec 5, 2024
1 parent 3458cb6 commit 082b392
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/wallet/token/balancefetcher/balance_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package balancefetcher

import (
"context"
"errors"
"math/big"
"sync"
"time"

"go.uber.org/zap"

"github.com/pkg/errors"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -69,8 +70,7 @@ func (bf *DefaultBalanceFetcher) fetchBalancesForChain(parent context.Context, c

ethScanContract, availableAtBlock, err := bf.contractMaker.NewEthScan(client.NetworkID())
if err != nil {
logutils.ZapLogger().Error("error scanning contract", zap.Error(err))
return nil, err
return nil, errors.Wrap(err, "error scanning contract")
}

fetchChainBalance := false
Expand Down Expand Up @@ -321,6 +321,7 @@ func (bf *DefaultBalanceFetcher) GetBalancesAtByChain(parent context.Context, cl
return nil, parent.Err()
}
if group.Error() != nil {
logutils.ZapLogger().Error("failed to get balances by chain", zap.Error(group.Error()))
return nil, group.Error()
}
return response, nil
Expand Down

0 comments on commit 082b392

Please sign in to comment.