Skip to content

Commit c57da4c

Browse files
committed
fix(MongoMemory*::start): add log of the error when async chain throws
1 parent 238350c commit c57da4c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ export class MongoMemoryReplSet extends EventEmitter implements ManagerAdvanced
362362
);
363363
}
364364

365+
log('ensureAsync chain threw a Error: ', err);
366+
365367
await this.stop(false); // still try to close the instance that was spawned, without cleanup for investigation
366368

367369
this.stateChange(MongoMemoryReplSetStates.stopped);

packages/mongodb-memory-server-core/src/MongoMemoryServer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
285285
);
286286
}
287287

288+
this.debug('_startUpInstance threw a Error: ', err);
289+
288290
await this.stop(false); // still try to close the instance that was spawned, without cleanup for investigation
289291

290292
this.stateChange(MongoMemoryServerStates.stopped);

0 commit comments

Comments
 (0)