@@ -153,7 +153,7 @@ func NewChaincodeSupport(getCCEndpoint func() (*pb.PeerEndpoint, error), userrun
153
153
154
154
ccEndpoint , err := getCCEndpoint ()
155
155
if err != nil {
156
- chaincodeLogger .Errorf ("Error getting chaincode endpoint because %v, using %s" , err , peerAddressDefault )
156
+ chaincodeLogger .Errorf ("Error getting chaincode endpoint using %s: %+v " , peerAddressDefault , err )
157
157
theChaincodeSupport .peerAddress = peerAddressDefault
158
158
} else {
159
159
theChaincodeSupport .peerAddress = ccEndpoint .Address
@@ -325,8 +325,9 @@ func (chaincodeSupport *ChaincodeSupport) sendReady(context context.Context, ccc
325
325
var ok bool
326
326
if chrte , ok = chaincodeSupport .chaincodeHasBeenLaunched (canName ); ! ok {
327
327
chaincodeSupport .runningChaincodes .Unlock ()
328
- chaincodeLogger .Debugf ("handler not found for chaincode %s" , canName )
329
- return errors .Errorf ("handler not found for chaincode %s" , canName )
328
+ err := errors .Errorf ("handler not found for chaincode %s" , canName )
329
+ chaincodeLogger .Debugf ("%+v" , err )
330
+ return err
330
331
}
331
332
chaincodeSupport .runningChaincodes .Unlock ()
332
333
@@ -532,10 +533,10 @@ func (chaincodeSupport *ChaincodeSupport) launchAndWaitForRegister(ctxt context.
532
533
err = errors .Errorf ("timeout expired while starting chaincode %s(networkid:%s,peerid:%s,tx:%s)" , canName , chaincodeSupport .peerNetworkID , chaincodeSupport .peerID , cccid .TxID )
533
534
}
534
535
if err != nil {
535
- chaincodeLogger .Debugf ("stopping due to error while launching %s " , err )
536
+ chaincodeLogger .Debugf ("stopping due to error while launching: %+v " , err )
536
537
errIgnore := chaincodeSupport .Stop (ctxt , cccid , cds )
537
538
if errIgnore != nil {
538
- chaincodeLogger .Debugf ("error on stop %s(%s) " , errIgnore , err )
539
+ chaincodeLogger .Debugf ("stop failed: %+v " , errIgnore )
539
540
}
540
541
}
541
542
return err
@@ -606,8 +607,8 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, cccid
606
607
if chrte , ok = chaincodeSupport .chaincodeHasBeenLaunched (canName ); ok {
607
608
if ! chrte .handler .registered {
608
609
chaincodeSupport .runningChaincodes .Unlock ()
609
- chaincodeLogger .Debugf ("premature execution - chaincode (%s) launched and waiting for registration" , canName )
610
610
err = errors .Errorf ("premature execution - chaincode (%s) launched and waiting for registration" , canName )
611
+ chaincodeLogger .Debugf ("%+v" , err )
611
612
return cID , cMsg , err
612
613
}
613
614
if chrte .handler .isRunning () {
@@ -692,7 +693,7 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, cccid
692
693
cLang := cds .ChaincodeSpec .Type
693
694
err = chaincodeSupport .launchAndWaitForRegister (context , cccid , cds , cLang , builder )
694
695
if err != nil {
695
- chaincodeLogger .Errorf ("launchAndWaitForRegister failed %s " , err )
696
+ chaincodeLogger .Errorf ("launchAndWaitForRegister failed: %+v " , err )
696
697
return cID , cMsg , err
697
698
}
698
699
}
@@ -701,11 +702,11 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, cccid
701
702
//launch will set the chaincode in Ready state
702
703
err = chaincodeSupport .sendReady (context , cccid , chaincodeSupport .ccStartupTimeout )
703
704
if err != nil {
704
- chaincodeLogger .Errorf ("sending init failed(%s)" , err )
705
705
err = errors .WithMessage (err , "failed to init chaincode" )
706
+ chaincodeLogger .Errorf ("%+v" , err )
706
707
errIgnore := chaincodeSupport .Stop (context , cccid , cds )
707
708
if errIgnore != nil {
708
- chaincodeLogger .Errorf ("stop failed %s(%s) " , errIgnore , err )
709
+ chaincodeLogger .Errorf ("stop failed: %+v " , errIgnore )
709
710
}
710
711
}
711
712
chaincodeLogger .Debug ("sending init completed" )
0 commit comments