File tree 1 file changed +4
-2
lines changed
packages/mongodb-memory-server-core/src
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
676
676
( server ) => server . instanceInfo ?. instance . isInstancePrimary
677
677
) ;
678
678
assertion ( ! isNullOrUndefined ( primary ) , new Error ( 'No Primary found' ) ) ;
679
+ // this should be defined at this point, but is checked anyway (thanks to types)
679
680
assertion (
680
681
! isNullOrUndefined ( primary . instanceInfo ) ,
681
- new Error ( 'Primary dosnt have "instanceInfo" defined' ) // TODO: change to "InstanceInfoError"
682
+ new InstanceInfoError ( '_initReplSet authIsObject primary' )
682
683
) ;
683
684
684
685
await primary . createAuth ( primary . instanceInfo ) ;
@@ -764,8 +765,9 @@ export class MongoMemoryReplSet extends EventEmitter implements ManagerAdvanced
764
765
new Promise < void > ( ( res , rej ) => {
765
766
const instanceInfo = server . instanceInfo ;
766
767
768
+ // this should be defined at this point, but is checked anyway (thanks to types)
767
769
if ( isNullOrUndefined ( instanceInfo ) ) {
768
- return rej ( new Error ( '_waitForPrimary - instanceInfo not present ' ) ) ; // TODO: change to "InstanceInfoError"
770
+ return rej ( new InstanceInfoError ( '_waitForPrimary Primary race ' ) ) ;
769
771
}
770
772
771
773
instanceInfo . instance . once ( MongoInstanceEvents . instancePrimary , res ) ;
You can’t perform that action at this time.
0 commit comments