Skip to content

Commit

Permalink
fix: Add info about debug option, when fails mongod start
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed May 17, 2017
1 parent a9d3923 commit fa9832c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ export default class MongoDBMemoryServer {

// Download if not exists mongo binaries in ~/.mongodb-prebuilt
// After that startup MongoDB instance
await mongodCli.run();
await mongodCli.run().catch(err => {
if (!this.opts.debug) {
throw new Error(
`${err.message}\n\nUse debug option for more info: new MongoMemoryServer({ debug: true })`
);
}
throw err;
});

data.mongodCli = mongodCli;
data.tmpDir = tmpDir;
Expand Down

0 comments on commit fa9832c

Please sign in to comment.