Skip to content

Commit 1259dc2

Browse files
authored
Improve "invalid block" error message (#160)
1 parent 15c601f commit 1259dc2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/ethkit/balance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (c *balance) Run(cmd *cobra.Command, args []string) error {
8383
}
8484
block = bh
8585
} else {
86-
return errors.New("error: invalid block height")
86+
return fmt.Errorf("error: invalid block height: %w", err)
8787
}
8888
}
8989

cmd/ethkit/block.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (c *block) Run(cmd *cobra.Command, args []string) error {
8787
bh, err := strconv.ParseUint(fBlock, 10, 64)
8888
if err != nil {
8989
// TODO: implement support for all tags: earliest, latest, pending, finalized, safe
90-
return errors.New("error: invalid block height")
90+
return fmt.Errorf("error: invalid block height: %w", err)
9191
}
9292

9393
block, err := provider.BlockByNumber(context.Background(), big.NewInt(int64(bh)))

0 commit comments

Comments
 (0)