Commit 86e0a0aa authored by Jason Yellick's avatar Jason Yellick Committed by Gerrit Code Review
Browse files

Merge "FAB-10855 Cleanup unsupported capabilities panic msgs"

parents 9c5a8bc9 f2c1a47f
......@@ -130,11 +130,11 @@ func capabilitiesSupportedOrPanic(res channelconfig.Resources) {
}
if err := ac.Capabilities().Supported(); err != nil {
peerLogger.Panicf("[channel %s] incompatible %s", res.ConfigtxValidator(), err)
peerLogger.Panicf("[channel %s] incompatible: %s", res.ConfigtxValidator().ChainID(), err)
}
if err := res.ChannelConfig().Capabilities().Supported(); err != nil {
peerLogger.Panicf("[channel %s] incompatible %s", res.ConfigtxValidator(), err)
peerLogger.Panicf("[channel %s] incompatible: %s", res.ConfigtxValidator().ChainID(), err)
}
}
......@@ -232,7 +232,7 @@ func Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccp
func InitChain(cid string) {
if chainInitializer != nil {
// Initialize chaincode, namely deploy system CC
peerLogger.Debugf("Init chain %s", cid)
peerLogger.Debugf("Initializing channel %s", cid)
chainInitializer(cid)
}
}
......@@ -372,13 +372,13 @@ func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block, ccp ccp
ordererAddresses := bundle.ChannelConfig().OrdererAddresses()
if len(ordererAddresses) == 0 {
return errors.New("No ordering service endpoint provided in configuration block")
return errors.New("no ordering service endpoint provided in configuration block")
}
// TODO: does someone need to call Close() on the transientStoreFactory at shutdown of the peer?
store, err := TransientStoreFactory.OpenStore(bundle.ConfigtxValidator().ChainID())
if err != nil {
return errors.Wrapf(err, "Failed opening transient store for %s", bundle.ConfigtxValidator().ChainID())
return errors.Wrapf(err, "[channel %s] failed opening transient store", bundle.ConfigtxValidator().ChainID())
}
csStoreSupport := &collectionSupport{
PeerLedger: ledger,
......@@ -413,7 +413,7 @@ func CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sc
var l ledger.PeerLedger
if l, err = ledgermgmt.CreateLedger(cb); err != nil {
return fmt.Errorf("Cannot create ledger from genesis block, due to %s", err)
return errors.WithMessage(err, "cannot create ledger from genesis block")
}
return createChain(cid, l, cb, ccp, sccp, pluginMapper)
......@@ -612,7 +612,7 @@ func GetMSPIDs(cid string) []string {
return nil
}
// SetCurrConfigBlock sets the current config block of the specified chain
// SetCurrConfigBlock sets the current config block of the specified channel
func SetCurrConfigBlock(block *common.Block, cid string) error {
chains.Lock()
defer chains.Unlock()
......@@ -620,7 +620,7 @@ func SetCurrConfigBlock(block *common.Block, cid string) error {
c.cb = block
return nil
}
return fmt.Errorf("Chain %s doesn't exist on the peer", cid)
return errors.Errorf("[channel %s] channel not associated with this peer", cid)
}
// GetLocalIP returns the non loopback local IP of the host
......@@ -724,7 +724,7 @@ func (flbs fileLedgerBlockStore) RetrieveBlocks(startBlockNumber uint64) (common
return flbs.GetBlocksIterator(startBlockNumber)
}
// NewResourceConfigSupport returns
// NewConfigSupport returns
func NewConfigSupport() cc.Manager {
return &configSupport{}
}
......@@ -741,7 +741,7 @@ func (*configSupport) GetChannelConfig(channel string) cc.Config {
defer chains.RUnlock()
chain := chains.list[channel]
if chain == nil {
peerLogger.Error("GetChannelConfig: channel", channel, "not found in the list of channels associated with this peer")
peerLogger.Errorf("[channel %s] channel not associated with this peer", channel)
return nil
}
return chain.cs.bundleSource.ConfigtxValidator()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment