File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/mongodb-memory-server-core/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -676,9 +676,10 @@ export class MongoMemoryReplSet extends EventEmitter implements ManagerAdvanced
676676 ( server ) => server . instanceInfo ?. instance . isInstancePrimary
677677 ) ;
678678 assertion ( ! isNullOrUndefined ( primary ) , new Error ( 'No Primary found' ) ) ;
679+ // this should be defined at this point, but is checked anyway (thanks to types)
679680 assertion (
680681 ! isNullOrUndefined ( primary . instanceInfo ) ,
681- new Error ( 'Primary dosnt have "instanceInfo" defined' ) // TODO: change to "InstanceInfoError"
682+ new InstanceInfoError ( '_initReplSet authIsObject primary' )
682683 ) ;
683684
684685 await primary . createAuth ( primary . instanceInfo ) ;
@@ -764,8 +765,9 @@ export class MongoMemoryReplSet extends EventEmitter implements ManagerAdvanced
764765 new Promise < void > ( ( res , rej ) => {
765766 const instanceInfo = server . instanceInfo ;
766767
768+ // this should be defined at this point, but is checked anyway (thanks to types)
767769 if ( isNullOrUndefined ( instanceInfo ) ) {
768- return rej ( new Error ( '_waitForPrimary - instanceInfo not present ' ) ) ; // TODO: change to "InstanceInfoError"
770+ return rej ( new InstanceInfoError ( '_waitForPrimary Primary race ' ) ) ;
769771 }
770772
771773 instanceInfo . instance . once ( MongoInstanceEvents . instancePrimary , res ) ;
You can’t perform that action at this time.
0 commit comments