Skip to content
This repository was archived by the owner on Nov 19, 2017. It is now read-only.
This repository was archived by the owner on Nov 19, 2017. It is now read-only.

Error handling in db/migrations/migrate.initDB #6

Open
@slmyers

Description

@slmyers

Errors do not seem to be properly caught in the promise chain. Investigate.

function initDB(config) {
  const masterMapping   = mapper.generateMasterMapping(mapper.gatherScreenerMappings());
  testConnect(config.client)
  // master index and mappings
  .then(utils.initIndex(config.client, config.masterIndex))
  .then(utils.initMapping(config.client, config.masterIndex, config.masterTypeName, masterMapping))
  // response index and mappings
  .then(utils.initIndex(config.client, config.responseIndex))
  .then(utils.initMapping(config.client, config.responseIndex, config.responseTypeName, responseMapping))
  .then(initPercolators(config.client, config.masterIndex))
  .catch( e => {
    console.log(`exiting with ${e}`);
    process.exit(1);
  })
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions