Skip to content

Commit

Permalink
style(MongoMemoryReplSet): rename error variables from "e" to "err"
Browse files Browse the repository at this point in the history
to be consistent with other code
  • Loading branch information
hasezoey committed Aug 22, 2022
1 parent 4bc2b22 commit 99d556d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,17 @@ export class MongoMemoryReplSet extends EventEmitter implements ManagerAdvanced
await primary.createAuth(primary.instanceInfo);
this._ranCreateAuth = true;
}
} catch (e) {
if (e instanceof MongoError && e.errmsg == 'already initialized') {
log(`_initReplSet: "${e.errmsg}": trying to set old config`);
} catch (err) {
if (err instanceof MongoError && err.errmsg == 'already initialized') {
log(`_initReplSet: "${err.errmsg}": trying to set old config`);
const { config: oldConfig } = await adminDb.command({ replSetGetConfig: 1 });
log('_initReplSet: got old config:\n', oldConfig);
await adminDb.command({
replSetReconfig: oldConfig,
force: true,
});
} else {
throw e;
throw err;
}
}
log('_initReplSet: ReplSet-reconfig finished');
Expand Down

0 comments on commit 99d556d

Please sign in to comment.