index.js
function _getAll (config) {
  return Promise.all(
    handleBlocks(config)
  ).then(function (results) {
    let result = {}
    results.forEach(function (block) {
      result[block.blockName] = block.result
    })
    return result
  })
    .catch(err => {
      var blockName = err.options ? err.options.uri : 'NO URI FOUND'
      log.error(`WARNING! 
      NO BLOCKS WILL BE LOADED DUE TO ERROR IN ONE OF THE BLOCKS. 
      FIX ALL BROKEN BLOCKS IMMEDIATELY. 
      ATTEMPTED TO LOAD BLOCK: ${blockName}`)
      throw err
    })
}
function _getAll (config) {
  return Promise.all(
    handleBlocks(config)
  ).then(function (results) {
    let result = {}
    results.forEach(function (block) {
      result[block.blockName] = block.result
    })
    return result
  })
    .catch(err => {
      var blockName = err.options ? err.options.uri : 'NO URI FOUND'
      log.error(`WARNING! 
      NO BLOCKS WILL BE LOADED DUE TO ERROR IN ONE OF THE BLOCKS. 
      FIX ALL BROKEN BLOCKS IMMEDIATELY. 
      ATTEMPTED TO LOAD BLOCK: ${blockName}`)
      throw err
    })
}
function _getAll ( config ) { return Promise . all ( handleBlocks ( config ) ) . then ( function ( results ) { let result = { } results . forEach ( function ( block ) { result [ block . blockName ] = block . result } ) return result } ) . catch ( err => { var blockName = err . options ? err . options . uri : 'NO URI FOUND' log . error ( ` ${ blockName } ` ) throw err } ) }
Fetch all Cortina blocks from API.
@param config the given cinfig
@returns {Promise}
@private
Fetch all Cortina blocks from API .