Skip to content

Commit

Permalink
[FAB-7758] Fix mismatch extra format verbs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nao Nishijima committed Jan 16, 2018
1 parent ce1f6a4 commit 688dd32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/chaincode/shim/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 688dd32

Please sign in to comment.