davidkel / hlf

0 stars 0 forks source link

Unexpected Warn and Error log entries when chaincode returns a shim.Error #32

Open davidkel opened 4 years ago

davidkel commented 4 years ago

While doing some testing of shim.Error returns I noticed log output to the console at warn and error level. However these are not issues with the sdk itself or the infrastructure but rather application level responses and as such probably should be logged at a lower level. The following were noticed for each of the particular calls with and without discovery

With discovery enabled sendTransactionProposal: 2019-07-26T13:32:11.995Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: I'm shim error

evaluateTransaction: 2019-07-26T13:33:36.988Z - warn: [Query]: evaluate: Query ID "[object Object]" of peer "peer0.org1.example.com:17051" failed: message=I'm shim error, stack=Error: I'm shim error

submitTransaction: 2019-07-26T13:34:05.665Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: I'm shim error

No Discovery

submitTransaction: 2019-07-26T13:35:20.472Z - warn: [Transaction]: _validatePeerResponses: Received error response from peer: message=I'm shim error, stack=Error: I'm shim error 2019-07-26T13:35:20.475Z - error: [Transaction]: _validatePeerResponses: No valid responses from any peers. 1 peer error responses: peer=peer0.org1.example.com, status=500, message=I'm shim error

evaluateTransaction: 2019-07-26T13:36:34.169Z - warn: [Query]: evaluate: Query ID "[object Object]" of peer "peer0.org1.example.com" failed: message=I'm shim error, stack=Error:I'm shim error

Note also the [object Object] for the evaluate transaction

Of course these should only be suppressed for chaincode responses. other types of responses such as grpc or peer errors should be logged as before.