@@ -227,14 +227,14 @@ func (e *Endorser) simulateProposal(ctx context.Context, chainID string, txid st
227
227
if ! syscc .IsSysCC (cid .Name ) {
228
228
cdLedger , err = e .getCDSFromLSCC (ctx , chainID , txid , signedProp , prop , cid .Name , txsim )
229
229
if err != nil {
230
- return nil , nil , nil , nil , fmt .Errorf ("failed to obtain cds for %s - %s " , cid .Name , err )
230
+ return nil , nil , nil , nil , fmt .Errorf ("%s - make sure the chaincode %s has been successfully instantiated and try again " , err , cid .Name )
231
231
}
232
232
version = cdLedger .Version
233
233
234
234
// we retrieve info about this chaincode from the file system
235
235
ccpack , err := ccprovider .GetChaincodeFromFS (cid .Name , version )
236
236
if err != nil {
237
- return nil , nil , nil , nil , fmt .Errorf ("Chaincode data for cc %s/%s was not found, error %s" , cid .Name , version , err )
237
+ return nil , nil , nil , nil , fmt .Errorf ("chaincode %s/%s not found on the file system , error %s" , cid .Name , version , err )
238
238
}
239
239
// ccpack is guaranteed to be non-nil
240
240
cdLocalFS := ccpack .GetChaincodeData ()
@@ -253,7 +253,7 @@ func (e *Endorser) simulateProposal(ctx context.Context, chainID string, txid st
253
253
// https://jira.hyperledger.org/browse/FAB-3156
254
254
if cdLocalFS .InstantiationPolicy != nil {
255
255
if ! bytes .Equal (cdLocalFS .InstantiationPolicy , cdLedger .InstantiationPolicy ) {
256
- return nil , nil , nil , nil , fmt .Errorf ("Instantiation policy mismatch for cc %s/%s" , cid .Name , version )
256
+ return nil , nil , nil , nil , fmt .Errorf ("instantiation policy mismatch for cc %s/%s" , cid .Name , version )
257
257
}
258
258
}
259
259
} else {
@@ -266,7 +266,7 @@ func (e *Endorser) simulateProposal(ctx context.Context, chainID string, txid st
266
266
var ccevent * pb.ChaincodeEvent
267
267
res , ccevent , err = e .callChaincode (ctx , chainID , version , txid , signedProp , prop , cis , cid , txsim )
268
268
if err != nil {
269
- endorserLogger .Errorf ("callChaincode() failed for txid: %s error: %s" , txid , err )
269
+ endorserLogger .Errorf ("failed to invoke chaincode %s on transaction %s, error: %s" , cid , txid , err )
270
270
return nil , nil , nil , nil , err
271
271
}
272
272
@@ -423,7 +423,7 @@ func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedPro
423
423
// here we handle uniqueness check and ACLs for proposals targeting a chain
424
424
lgr := peer .GetLedger (chainID )
425
425
if lgr == nil {
426
- return nil , errors . New ( fmt .Sprintf ( "Failure while looking up the ledger %s" , chainID ) )
426
+ return nil , fmt .Errorf ( "failure while looking up the ledger %s" , chainID )
427
427
}
428
428
if _ , err := lgr .GetTransactionByID (txid ); err == nil {
429
429
return nil , fmt .Errorf ("Duplicate transaction found [%s]. Creator [%x]. [%s]" , txid , shdr .Creator , err )
0 commit comments