From 4c4ec8db1e62e709092ba81db5154e6c2b3be0c4 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 15 Mar 2024 10:50:35 -0400 Subject: [PATCH] fix err handling --- relayer/pkg/starknet/chain_client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relayer/pkg/starknet/chain_client.go b/relayer/pkg/starknet/chain_client.go index e2d039b5a..921b620f7 100644 --- a/relayer/pkg/starknet/chain_client.go +++ b/relayer/pkg/starknet/chain_client.go @@ -2,11 +2,11 @@ package starknet import ( "context" + "fmt" "github.com/NethermindEth/juno/core/felt" starknetrpc "github.com/NethermindEth/starknet.go/rpc" gethrpc "github.com/ethereum/go-ethereum/rpc" - "github.com/pkg/errors" ) // type alias for readibility @@ -47,13 +47,13 @@ func (c *Client) BlockByHash(ctx context.Context, h *felt.Felt) (FinalizedBlock, block, err := c.Provider.BlockWithTxs(ctx, starknetrpc.BlockID{Hash: h}) if err != nil { - return FinalizedBlock{}, errors.Wrap(err, "error in BlockByHash") + return FinalizedBlock{}, fmt.Errorf("error in BlockByHash: %w", err) } finalizedBlock, ok := block.(*FinalizedBlock) if !ok { - return FinalizedBlock{}, errors.Errorf("expected type Finalized block but found: %T", block) + return FinalizedBlock{}, fmt.Errorf("expected type Finalized block but found: %T", block) } return *finalizedBlock, nil