From 10d4b9db7f3275280d04f65055f3b0aa1c0919fd Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Wed, 27 Nov 2024 09:38:11 -0800 Subject: [PATCH] update error message --- fvm/evm/offchain/storage/readonly.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fvm/evm/offchain/storage/readonly.go b/fvm/evm/offchain/storage/readonly.go index 4ed33a6fe44..6c66e7c1e43 100644 --- a/fvm/evm/offchain/storage/readonly.go +++ b/fvm/evm/offchain/storage/readonly.go @@ -1,7 +1,7 @@ package storage import ( - "errors" + "fmt" "github.com/onflow/atree" @@ -29,7 +29,7 @@ func (s *ReadOnlyStorage) GetValue(owner []byte, key []byte) ([]byte, error) { // SetValue returns an error if called func (s *ReadOnlyStorage) SetValue(owner, key, value []byte) error { - return errors.New("unexpected call received") + return fmt.Errorf("unexpected call received for SetValue with owner: %x, key: %v, value: %x", owner, key, value) } // ValueExists checks if a register exists @@ -40,5 +40,5 @@ func (s *ReadOnlyStorage) ValueExists(owner []byte, key []byte) (bool, error) { // AllocateSlabIndex returns an error if called func (s *ReadOnlyStorage) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error) { - return atree.SlabIndex{}, errors.New("unexpected call received") + return atree.SlabIndex{}, fmt.Errorf("unexpected call received for AllocateSlabIndex with owner: %x", owner) }