diff --git a/peer/chaincode/common.go b/peer/chaincode/common.go index d40c3d20fa6..c9667b5a8d0 100644 --- a/peer/chaincode/common.go +++ b/peer/chaincode/common.go @@ -125,7 +125,7 @@ func chaincodeInvokeOrQuery(cmd *cobra.Command, invoke bool, cf *ChaincodeCmdFac return errors.WithMessage(err, "error while unmarshaling chaincode action") } if proposalResp.Endorsement == nil { - return errors.Errorf("endorsement failure during invoke. chaincode result: %v", ca.Response) + return errors.Errorf("endorsement failure during invoke. response: %v", proposalResp.Response) } logger.Infof("Chaincode invoke successful. result: %v", ca.Response) } else { diff --git a/peer/chaincode/invoke_test.go b/peer/chaincode/invoke_test.go index 9dc6f895880..269a9887383 100644 --- a/peer/chaincode/invoke_test.go +++ b/peer/chaincode/invoke_test.go @@ -218,7 +218,7 @@ func TestInvokeCmdEndorsementFailure(t *testing.T) { err = cmd.Execute() assert.Error(t, err) assert.Contains(t, err.Error(), "endorsement failure during invoke") - assert.Contains(t, err.Error(), fmt.Sprintf("chaincode result: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i])) + assert.Contains(t, err.Error(), fmt.Sprintf("response: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i])) } }