Skip to content

Commit

Permalink
Add peer log message for failure to invoke chaincode (#2339)
Browse files Browse the repository at this point in the history
When looking in peer log to troubleshoot chaincode invocations,
there is currently no difference between a successful
invocation and a failure to execute, they all look successful.
This change adds a log Warning with error message for each failure to invoke.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>

Co-authored-by: David Enyeart <denyeart@Davids-MBP.nc.rr.com>
(cherry picked from commit 4e74441)
  • Loading branch information
denyeart committed Feb 2, 2021
1 parent 0583c22 commit eb2b1ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedPro

pResp, err := e.ProcessProposalSuccessfullyOrError(up)
if err != nil {
endorserLogger.Warnw("Failed to invoke chaincode", "channel", up.ChannelHeader.ChannelId, "chaincode", up.ChaincodeName, "error", err.Error())
return &pb.ProposalResponse{Response: &pb.Response{Status: 500, Message: err.Error()}}, nil
}

Expand Down

0 comments on commit eb2b1ea

Please sign in to comment.