Skip to content

Commit c01fec7

Browse files
committed
style(MongoInstance::closeHandler): add note that "instanceError" gets emitted on signal
1 parent 2c54e1f commit c01fec7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/mongodb-memory-server-core/src/util/MongoInstance.ts

+1
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ export class MongoInstance extends EventEmitter implements ManagerBase {
513513
// https://docs.mongodb.com/manual/reference/exit-codes/#12
514514
if ((process.platform === 'win32' && code != 12 && code != 0) || code != 0) {
515515
this.debug('closeHandler: Mongod instance closed with an non-0 (or non 12 on windows) code!');
516+
// Note: this also emits when a signal is present, which is expected because signals are not expected here
516517
this.emit(MongoInstanceEvents.instanceError, new UnexpectedCloseError(code, signal));
517518
}
518519

0 commit comments

Comments
 (0)