-
Notifications
You must be signed in to change notification settings - Fork 642
(feature) optional param added to throwIfNotFound method #1767
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
(feature) optional param added to throwIfNotFound method #1767
Conversation
|
|
||
| | Argument | Type | Description | | ||
| | -------- | ------ | -------------------------------- | | ||
| | data | object | optional object with custom data | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no way for people to use this based on this documentation. Where does this data go? What properties can it have? How are different properties treated (like the special case for message). The example below helps, but it only provides an example for the message. The rest of the data is more useful. You should never detect the error using the message in the client or further down in the request handing. You should use some other property, which you could provide using the data. An example/explanation of that would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the description and added a custom type example, is that sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's excellent!
tests/integration/find.js
Outdated
| }); | ||
|
|
||
| it('.throwIfNotFound() with empty result', done => { | ||
| it('custom .throwIfNotFound() with empty result', done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add the word custom here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was a typo, reverted
|
Hi @vasdhara! Thank you so much for your contribution! I added a couple of comments. You also need to update the typescript typings. |
7dd721d to
9c4bb9d
Compare
|
@koskimas thanks. added fixes. Also, added a new interface for throwIfNotFound typings, since I couldn't find a previously written interface that could be reused in this case. |
closes #1722
Is this what was required for the feature request? Please let me know if I have missed anything. A first-time contributor so slightly overwhelmed.