From 5623a3533efce3439d4c210fdb84e88c5c47056e Mon Sep 17 00:00:00 2001 From: Rez Date: Sun, 23 Mar 2025 09:42:09 +1100 Subject: [PATCH] enhance error message --- internal/ethapi/api_test.go | 4 ++-- internal/ethapi/override/override.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 0f51c33ca1..b086d1a6d5 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -1141,7 +1141,7 @@ func TestCall(t *testing.T) { blockOverrides: override.BlockOverrides{ BeaconRoot: &common.Hash{0, 1, 2}, }, - expectErr: errors.New(`"beaconRoot" is not supported for this RPC method`), + expectErr: errors.New(`block override "beaconRoot" is not supported for this RPC method`), }, { name: "unsupported block override withdrawals", @@ -1150,7 +1150,7 @@ func TestCall(t *testing.T) { blockOverrides: override.BlockOverrides{ Withdrawals: &types.Withdrawals{}, }, - expectErr: errors.New(`"withdrawals" is not supported for this RPC method`), + expectErr: errors.New(`block override "withdrawals" is not supported for this RPC method`), }, } for _, tc := range testSuite { diff --git a/internal/ethapi/override/override.go b/internal/ethapi/override/override.go index 8845f73953..0bcf3c444d 100644 --- a/internal/ethapi/override/override.go +++ b/internal/ethapi/override/override.go @@ -139,10 +139,10 @@ func (o *BlockOverrides) Apply(blockCtx *vm.BlockContext) error { return nil } if o.BeaconRoot != nil { - return errors.New(`"beaconRoot" is not supported for this RPC method`) + return errors.New(`block override "beaconRoot" is not supported for this RPC method`) } if o.Withdrawals != nil { - return errors.New(`"withdrawals" is not supported for this RPC method`) + return errors.New(`block override "withdrawals" is not supported for this RPC method`) } if o.Number != nil { blockCtx.BlockNumber = o.Number.ToInt()