Skip to content

Commit fe5f2cd

Browse files
committed
Minor fix fmt.errorf to errors.new
Change-Id: I39c60d7834bc6a87e7d0601fcd4a607a4b3f85b2 Signed-off-by: grapebaba <[email protected]>
1 parent 4b53c7c commit fe5f2cd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/devops.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (d *Devops) Deploy(ctx context.Context, spec *pb.ChaincodeSpec) (*pb.Chainc
196196
}
197197
resp := d.coord.ExecuteTransaction(tx)
198198
if resp.Status == pb.Response_FAILURE {
199-
err = fmt.Errorf(string(resp.Msg))
199+
err = errors.New(string(resp.Msg))
200200
}
201201

202202
return chaincodeDeploymentSpec, err
@@ -205,7 +205,7 @@ func (d *Devops) Deploy(ctx context.Context, spec *pb.ChaincodeSpec) (*pb.Chainc
205205
func (d *Devops) invokeOrQuery(ctx context.Context, chaincodeInvocationSpec *pb.ChaincodeInvocationSpec, attributes []string, invoke bool) (*pb.Response, error) {
206206

207207
if chaincodeInvocationSpec.ChaincodeSpec.ChaincodeID.Name == "" {
208-
return nil, fmt.Errorf("name not given for invoke/query")
208+
return nil, errors.New("name not given for invoke/query")
209209
}
210210

211211
// Now create the Transactions message and send to Peer.
@@ -249,12 +249,10 @@ func (d *Devops) invokeOrQuery(ctx context.Context, chaincodeInvocationSpec *pb.
249249
if err != nil {
250250
return nil, err
251251
}
252-
if devopsLogger.IsEnabledFor(logging.DEBUG) {
253-
devopsLogger.Debugf("Sending invocation transaction (%s) to validator", transaction.Txid)
254-
}
252+
devopsLogger.Debugf("Sending invocation transaction (%s) to validator", transaction.Txid)
255253
resp := d.coord.ExecuteTransaction(transaction)
256254
if resp.Status == pb.Response_FAILURE {
257-
err = fmt.Errorf(string(resp.Msg))
255+
err = errors.New(string(resp.Msg))
258256
} else {
259257
if !invoke && nil != sec && viper.GetBool("security.privacy") {
260258
if resp.Msg, err = sec.DecryptQueryResult(transaction, resp.Msg); nil != err {

0 commit comments

Comments
 (0)