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

If async validator throws an error, support using that error's message instead of mongoose's message templating #6812

Closed
vkarpov15 opened this issue Aug 4, 2018 · 1 comment
Labels
discussion If you have any thoughts or comments on this issue, please share them! enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature

Comments

@vkarpov15
Copy link
Collaborator

Re: issues like #6772. Right now the best workaround looks like this:

schema.path('foo').validate({
  validator,
  message: props => props.reason.message
});

I'm not sure what this API would look like though, looking for suggestions.

@vkarpov15 vkarpov15 added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature discussion If you have any thoughts or comments on this issue, please share them! labels Aug 4, 2018
@vkarpov15 vkarpov15 added this to the 5.x Unprioritized milestone Aug 4, 2018
@vkarpov15
Copy link
Collaborator Author

Fixed in 5.6.0, see #4913

@vkarpov15 vkarpov15 removed this from the 5.x Unprioritized milestone Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion If you have any thoughts or comments on this issue, please share them! enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Projects
None yet
Development

No branches or pull requests

1 participant