Skip to content

Commit

Permalink
Merge "[FAB-12121] Invoke to return useful CLI error response" into r…
Browse files Browse the repository at this point in the history
…elease-1.3
  • Loading branch information
denyeart authored and Gerrit Code Review committed Oct 7, 2018
2 parents 5edfc76 + 90d0727 commit 389949d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion peer/chaincode/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion peer/chaincode/invoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
}
}

Expand Down

0 comments on commit 389949d

Please sign in to comment.