Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Replica Set options fixed and error gracefully handled #49

Closed
wants to merge 1 commit into from

Conversation

ayush-uipath
Copy link

Hey,

I am requesting you to merge this PR. This addresses 2 issues:

  1. options was not passed from the index file correctly into the ReplSet constructor. It needed to be an object with options key having a nested json with the actual options. I've addressed the same.

  2. The startRS catch block had an error in itself. If err didn't contain message field, we were still doing err.message.includes, which was breaking saying TypeError: Cannot read property 'includes' of undefined . I've added graceful handling of the same.

Please review.
Thanks,
Ayush Jain
2

@vkarpov15
Copy link
Owner

These issues were fixed in #50 and #48. Thanks for the PR though 👍

@vkarpov15 vkarpov15 closed this Nov 27, 2020
@@ -118,7 +118,7 @@ function* run() {
if (commander.bind_ip_all) {
options.bind_ip_all = null;
}
return options;
return {options: options};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vkarpov15 Did you check this line? I think this fix is needed and didn't go as part of #48 or #50

The way options is passed to ReplSet constructor is not in the format the Constructor expects it. That what i have fixed here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my bad, I see you have changed options to { options } . That addresses it. Thanks.

@@ -208,6 +208,7 @@ function startRS(rs) {
try {
yield rs.start();
} catch (err) {
err = err[0];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is addressed in #48 Not needed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants