Skip to content

Commit

Permalink
Merge branch 'main' into result_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlavanet committed Aug 29, 2024
2 parents 89238db + 520a81f commit a4f215d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion protocol/chainlib/base_chain_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion protocol/chainlib/consumer_websocket_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down
3 changes: 2 additions & 1 deletion protocol/chainlib/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion protocol/chainlib/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit a4f215d

Please sign in to comment.