Skip to content

Commit fa9832c

Browse files
committed
fix: Add info about debug option, when fails mongod start
1 parent a9d3923 commit fa9832c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ export default class MongoDBMemoryServer {
8585

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

9097
data.mongodCli = mongodCli;
9198
data.tmpDir = tmpDir;

0 commit comments

Comments
 (0)