Skip to content

Commit 8d2d4f0

Browse files
committed
better logging in case of jsonrpc errors
1 parent e5f7511 commit 8d2d4f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/rpc/serializer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func SerializeFullBlocks(chainId *big.Int, blocks []RPCFetchBatchResult[common.R
2626
BlockNumber: rawBlock.BlockNumber,
2727
}
2828
if rawBlock.Result == nil {
29-
log.Warn().Msgf("Received a nil block result for block %s.", rawBlock.BlockNumber.String())
30-
result.Error = fmt.Errorf("received a nil block result from RPC")
29+
log.Warn().Err(rawBlock.Error).Msgf("Received a nil block result for block %s.", rawBlock.BlockNumber.String())
30+
result.Error = fmt.Errorf("received a nil block result from RPC. %v", rawBlock.Error)
3131
results = append(results, result)
3232
continue
3333
}

0 commit comments

Comments
 (0)