From 688dd324446e17f26ff702b177c7c37917a55782 Mon Sep 17 00:00:00 2001 From: Nao Nishijima Date: Tue, 16 Jan 2018 09:45:34 -0800 Subject: [PATCH] [FAB-7758] Fix mismatch extra format verbs This CR fixes mismatched extra format verbs in core/chaincode/shim/ handle.go. errFunc() function receives error messages that includ format verbs. However, some errFunc() has a mismatch between format verbs and variables. Change-Id: Idc3ff553c380f60920377c102f8a133e8ad6a107 Signed-off-by: Nao Nishijima --- core/chaincode/shim/handler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/chaincode/shim/handler.go b/core/chaincode/shim/handler.go index fa95c224edf..2a3ba0ff089 100644 --- a/core/chaincode/shim/handler.go +++ b/core/chaincode/shim/handler.go @@ -247,7 +247,7 @@ func (handler *Handler) handleInit(msg *pb.ChaincodeMessage) { // Create the ChaincodeStub which the chaincode can use to callback stub := new(ChaincodeStub) err := stub.init(handler, msg.ChannelId, msg.Txid, input, msg.Proposal) - if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init get error response [%s]. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { + if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init get error response. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { return } @@ -256,13 +256,13 @@ func (handler *Handler) handleInit(msg *pb.ChaincodeMessage) { if res.Status >= ERROR { err = errors.New(res.Message) - if nextStateMsg = errFunc(err, []byte(res.Message), stub.chaincodeEvent, "[%s]Init get error response [%s]. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { + if nextStateMsg = errFunc(err, []byte(res.Message), stub.chaincodeEvent, "[%s]Init get error response. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { return } } resBytes, err := proto.Marshal(&res) - if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init marshal response error [%s]. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { + if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init marshal response error. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil { return }