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

DocumentNotFoundError not bubbled up by SDK #55

Open
bwgjoseph opened this issue Apr 3, 2021 · 9 comments
Open

DocumentNotFoundError not bubbled up by SDK #55

bwgjoseph opened this issue Apr 3, 2021 · 9 comments
Assignees
Labels
await-verification wait for new release to verify

Comments

@bwgjoseph
Copy link
Owner

From #41 (#41 (comment)), this is to track the issue separately from ottoman

@AV25242 AV25242 added follow-up Issue to follow-up internally and removed follow-up Issue to follow-up internally labels Apr 3, 2021
@AV25242
Copy link
Collaborator

AV25242 commented Apr 3, 2021

Thanks for tracking this separately, I have opened an issue internally with nodejs team to track

@AV25242 AV25242 added the issue-created an issue has been created for the team to work label Apr 3, 2021
bwgjoseph added a commit that referenced this issue Apr 13, 2021
updateMany and removeMany is not expected to throw DocumentNotFoundError since for multi-ops, it's a filter rather than providing a key

Reference #55
bwgjoseph added a commit that referenced this issue Apr 13, 2021
updateMany and removeMany is not expected to throw DocumentNotFoundError since for multi-ops, it's a filter rather than providing a key

Reference #55
@bwgjoseph
Copy link
Owner Author

I have updated the test case

And also, just a note... updateMany and removeMany are not expected to throw DocumentNotFoundError since for multi-ops, it's a filter rather than providing a key/id

@AV25242
Copy link
Collaborator

AV25242 commented Apr 14, 2021

All mutation operations are not returning back DocumentNotFoundError

@AV25242 AV25242 assigned bwgjoseph and unassigned AV25242 Apr 14, 2021
@josephstgh
Copy link
Collaborator

findOneAndUpdate
removeById
replaceById
updateById

@josephstgh josephstgh assigned AV25242 and unassigned bwgjoseph Apr 14, 2021
@AV25242
Copy link
Collaborator

AV25242 commented Apr 14, 2021

Thanks @bwgjoseph

@bwgjoseph
Copy link
Owner Author

With #56, findOne is now also part of the API that has the same issue. I noticed that you have a issue created in node-ottoman repository. Do include findOne as well. Thanks

@AV25242
Copy link
Collaborator

AV25242 commented Sep 20, 2021

fixed with beta.9

@AV25242 AV25242 added await-verification wait for new release to verify and removed issue-created an issue has been created for the team to work labels Sep 21, 2021
@AV25242 AV25242 assigned bwgjoseph and unassigned AV25242 Sep 21, 2021
@bwgjoseph
Copy link
Owner Author

Can I check if the cause and context stated as undefined is intended?

test $ignoreCase function
SELECT `callsign`,`name`,`operational`,`destination`,`sche`type`,`email`,`info`,`expiresAt`,`location`,`extension`,`ouchbase airlines" AND _type="Airplane" LIMIT 1
DocumentNotFoundError: document not found
    at Z:\Development\workspace\github\bwgjoseph\mongoose-\model\create-model.ts:216:13
    at Generator.next (<anonymous>)
    at fulfilled (Z:\Development\workspace\github\bwgjosepottoman\lib\model\create-model.js:5:58) {
  cause: undefined,
  context: undefined

@bwgjoseph bwgjoseph assigned AV25242 and unassigned bwgjoseph Sep 26, 2021
@bwgjoseph
Copy link
Owner Author

bwgjoseph commented Sep 26, 2021

Also, another suggestion to improve the exception message.

I'm not sure if it make sense to say why the document not found? is it useful?

Something like

Given

await Airplane.findOneAndRemove({ extension: 'abc1' });

Return

document not found because the given search field (extension: 'abc1') does not match anything

Probably adjust the message format a little but I think it might provide some context when looking at the error logs so it's quite useful to have something like that

bwgjoseph added a commit that referenced this issue Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await-verification wait for new release to verify
Projects
None yet
Development

No branches or pull requests

3 participants