Skip to content

Commit

Permalink
Reword duplicate error message
Browse files Browse the repository at this point in the history
There are two error paths that produce the same message.  Reword the second one to a more acurate description of the problem.

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
  • Loading branch information
andrew-coleman authored and manish-sethi committed Nov 1, 2021
1 parent d8ee1b4 commit 89da86e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (gs *Server) Endorse(ctx context.Context, request *gp.EndorseRequest) (*gp.
}

if endorsements == nil {
return nil, rpcError(codes.Aborted, "failed to endorse transaction, see attached details for more info", errorDetails...)
return nil, rpcError(codes.Aborted, "failed to collect enough transaction endorsements, see attached details for more info", errorDetails...)
}

env, err := protoutil.CreateTx(proposal, endorsements...)
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/gateway/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ func TestEndorse(t *testing.T) {
peer3Mock.client.(*mocks.EndorserClient).ProcessProposalReturns(nil, status.Error(codes.Aborted, "bad peer3 endorser"))
peer4Mock.client.(*mocks.EndorserClient).ProcessProposalReturns(nil, status.Error(codes.Aborted, "bad peer4 endorser"))
},
errString: "rpc error: code = Aborted desc = failed to endorse transaction, see attached details for more info",
errString: "rpc error: code = Aborted desc = failed to collect enough transaction endorsements, see attached details for more info",
errDetails: []*pb.ErrorDetail{
{Address: "peer2:9051", MspId: "msp2", Message: "rpc error: code = Aborted desc = bad peer2 endorser"},
{Address: "peer3:10051", MspId: "msp2", Message: "rpc error: code = Aborted desc = bad peer3 endorser"},
Expand Down Expand Up @@ -757,7 +757,7 @@ func TestEndorse(t *testing.T) {
postSetup: func(t *testing.T, def *preparedTest) {
def.localEndorser.ProcessProposalReturns(createProposalResponse(t, localhostMock.address, "all_good", 200, ""), nil)
},
errString: "rpc error: code = Aborted desc = failed to endorse transaction, see attached details for more info",
errString: "rpc error: code = Aborted desc = failed to collect enough transaction endorsements, see attached details for more info",
errDetails: []*pb.ErrorDetail{{
Address: "peer4:11051",
MspId: "msp3",
Expand Down Expand Up @@ -800,7 +800,7 @@ func TestEndorse(t *testing.T) {
postSetup: func(t *testing.T, def *preparedTest) {
def.localEndorser.ProcessProposalReturns(createProposalResponse(t, localhostMock.address, "all_good", 200, ""), nil)
},
errString: "rpc error: code = Aborted desc = failed to endorse transaction, see attached details for more info",
errString: "rpc error: code = Aborted desc = failed to collect enough transaction endorsements, see attached details for more info",
errDetails: []*pb.ErrorDetail{{
Address: "peer4:11051",
MspId: "msp3",
Expand Down

0 comments on commit 89da86e

Please sign in to comment.