From 17b7e4ff5c8ac8128c8c0a773f693550f972ddae Mon Sep 17 00:00:00 2001 From: denyeart Date: Tue, 2 Feb 2021 13:32:11 -0500 Subject: [PATCH] Add peer log message for failure to invoke chaincode (#2339) 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 Co-authored-by: David Enyeart (cherry picked from commit 4e74441ce886f27871330852991957e276591751) --- core/endorser/endorser.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/endorser/endorser.go b/core/endorser/endorser.go index 075854508ed..a7a857b1bad 100644 --- a/core/endorser/endorser.go +++ b/core/endorser/endorser.go @@ -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 }