diff --git a/protocol/chainlib/base_chain_parser.go b/protocol/chainlib/base_chain_parser.go index f94dfe9b49..d326bd7b83 100644 --- a/protocol/chainlib/base_chain_parser.go +++ b/protocol/chainlib/base_chain_parser.go @@ -340,7 +340,8 @@ func (apip *BaseChainParser) getApiCollection(connectionType, internalPath, addo // Return an error if spec does not exist if !ok { - return nil, utils.LavaFormatWarning("api not supported", common.APINotSupportedError, utils.Attribute{Key: "connectionType", Value: connectionType}) + utils.LavaFormatDebug("api not supported", utils.Attribute{Key: "connectionType", Value: connectionType}) + return nil, common.APINotSupportedError } // Return an error if api is disabled diff --git a/protocol/chainlib/consumer_websocket_manager.go b/protocol/chainlib/consumer_websocket_manager.go index aefb3878bc..a40ba14a6c 100644 --- a/protocol/chainlib/consumer_websocket_manager.go +++ b/protocol/chainlib/consumer_websocket_manager.go @@ -151,7 +151,8 @@ func (cwm *ConsumerWebsocketManager) ListenToMessages() { protocolMessage, err := cwm.relaySender.ParseRelay(webSocketCtx, "", string(msg), cwm.connectionType, dappID, userIp, metricsData, nil) if err != nil { - formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), utils.LavaFormatError("could not parse message", err), msgSeed, msg, cwm.apiInterface, time.Since(startTime)) + utils.LavaFormatDebug("ws manager could not parse message", utils.LogAttr("message", msg), utils.LogAttr("err", err)) + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), err, msgSeed, msg, cwm.apiInterface, time.Since(startTime)) if formatterMsg != nil { websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} } diff --git a/protocol/chainlib/rest.go b/protocol/chainlib/rest.go index 33e727ff6b..361f191a3c 100644 --- a/protocol/chainlib/rest.go +++ b/protocol/chainlib/rest.go @@ -173,10 +173,11 @@ func (apip *RestChainParser) getSupportedApi(name, connectionType string) (*ApiC // Return an error if spec does not exist if !ok { - return nil, utils.LavaFormatWarning("rest api not supported", common.APINotSupportedError, + utils.LavaFormatDebug("rest api not supported", utils.LogAttr("name", name), utils.LogAttr("connectionType", connectionType), ) + return nil, common.APINotSupportedError } api := apiCont.api diff --git a/protocol/chainlib/rest_test.go b/protocol/chainlib/rest_test.go index 7db8ff2125..291d184365 100644 --- a/protocol/chainlib/rest_test.go +++ b/protocol/chainlib/rest_test.go @@ -91,7 +91,6 @@ func TestRestGetSupportedApi(t *testing.T) { _, err = apip.getSupportedApi("API2", connectionType_test) assert.Error(t, err) assert.ErrorIs(t, err, common.APINotSupportedError) - assert.Equal(t, "rest api not supported ErrMsg: api not supported {name:API2,connectionType:test}: api not supported", err.Error()) // Test case 3: Returns error if the API is disabled apip = &RestChainParser{