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

Fixed uncaught dup key with caracal @ develop #140 #154

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AbhishekPanta8
Copy link

The duplicate key error in the collection was not handled so handled it.

Summary

added if condition check inside catch statement.

Motivation

Fixes uncaught dup key with caracal @ develop #140

Testing

Tested manually

Questions

@birm birm changed the base branch from master to develop March 31, 2023 05:48
@@ -87,7 +87,10 @@ class Mongo {
const res = await collection.insertMany(data);
return res;
} catch (e) {
if (silent) {
if (e.code === 11000) {
Copy link
Member

Choose a reason for hiding this comment

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

We should probably only silently return if 'silent' is true

Copy link
Author

Choose a reason for hiding this comment

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

Yes true, I have handled that case in else if statement.

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