Skip to content

Commit 688dd32

Browse files
author
Nao Nishijima
committed
[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 <nao.nishijima@hal.hitachi.com>
1 parent ce1f6a4 commit 688dd32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/chaincode/shim/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func (handler *Handler) handleInit(msg *pb.ChaincodeMessage) {
247247
// Create the ChaincodeStub which the chaincode can use to callback
248248
stub := new(ChaincodeStub)
249249
err := stub.init(handler, msg.ChannelId, msg.Txid, input, msg.Proposal)
250-
if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init get error response [%s]. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil {
250+
if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init get error response. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil {
251251
return
252252
}
253253

@@ -256,13 +256,13 @@ func (handler *Handler) handleInit(msg *pb.ChaincodeMessage) {
256256

257257
if res.Status >= ERROR {
258258
err = errors.New(res.Message)
259-
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 {
259+
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 {
260260
return
261261
}
262262
}
263263

264264
resBytes, err := proto.Marshal(&res)
265-
if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init marshal response error [%s]. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil {
265+
if nextStateMsg = errFunc(err, nil, stub.chaincodeEvent, "[%s]Init marshal response error. Sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_ERROR.String()); nextStateMsg != nil {
266266
return
267267
}
268268

0 commit comments

Comments
 (0)