From d61dc436969fc9b81ea3b273aa3b1dc94212509a Mon Sep 17 00:00:00 2001 From: Confucian Date: Tue, 22 Oct 2024 12:49:36 +0800 Subject: [PATCH] feat: return revert data --- rpc/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/client.go b/rpc/client.go index f9a8f1116b..23c1716632 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -365,7 +365,8 @@ func (c *Client) CallContext(ctx context.Context, result interface{}, method str resp := batchresp[0] switch { case resp.Error != nil: - return resp.Error + errMsg := fmt.Sprintf("%s: %s", resp.Error.Message, resp.Error.Data) + return errors.New(errMsg) case len(resp.Result) == 0: return ErrNoResult default: