From 38c56bdfe7cf803cde3e5bb53e62914c1a51e7e2 Mon Sep 17 00:00:00 2001 From: Ran Mishael <106548467+ranlavanet@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:35:25 +0200 Subject: [PATCH] PRT - adding warning prints when get result returns an error. (#556) --- .../chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go | 3 +++ .../chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go index da594c5c9d..aeee79cf1f 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go @@ -55,6 +55,9 @@ func (cp JsonrpcMessage) GetParams() interface{} { } func (cp JsonrpcMessage) GetResult() json.RawMessage { + if cp.Error != nil { + utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: cp.Error}) + } return cp.Result } diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go index 337efff031..c675e0c7fc 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go @@ -22,6 +22,9 @@ func (cp TendermintrpcMessage) GetParams() interface{} { } func (cp TendermintrpcMessage) GetResult() json.RawMessage { + if cp.Error != nil { + utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: cp.Error}) + } return cp.Result }