-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Implement em::findOneOrFail #133
Comments
Agreed, I am usually defining this method in custom base repository, but sure we can have it integrated as well. Personally I am using custom Maybe better name would be |
I supposed that this method would be used only for situations, where the entity should be in database, and if there is no entity server should return |
I think that could cause a lot of confusion, I would like to have only one method for this. Btw for your |
Yep, manually. |
I would like
|
findOne already has more complex interface:
But yes, I like the idea to allow overriding the default exception handler via it's parameters, probably via |
Available for testing in |
Is your feature request related to a problem? Please describe.
Sometimes it's very convenient to have a short method that will fail-fast if nothing was found.
Describe the solution you'd like
em::findOrFail
that returnPromise<T>
or throw exception if entity wasn't found.The text was updated successfully, but these errors were encountered: