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

custom error msgs for built-in validators #747

Closed
aheckmann opened this issue Feb 23, 2012 · 12 comments
Closed

custom error msgs for built-in validators #747

aheckmann opened this issue Feb 23, 2012 · 12 comments
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature

Comments

@aheckmann
Copy link
Collaborator

No description provided.

@ManInTheBox
Copy link

Hi Aaron,

Thanks for this (I asked for this on stackoverflow and google group thread).
Yesterday I forked mongoose in order to fix this. Look at my fork and tell me your opinions please.
Thanks

@thanpolas
Copy link
Contributor

@ManInTheBox @aheckmann ?

I am resorting to not use any of the built-in validators just for this reason...

@daslicht
Copy link

So is there meanwhile a way to define custom error messages for the built ion validator?

@kokujin
Copy link

kokujin commented Aug 25, 2013

I second daslicht, how does one define custom error messages for the built ion validator?

@aheckmann
Copy link
Collaborator Author

Its on its way for 3.7.x: https://github.com/LearnBoost/mongoose/compare/747

@daslicht
Copy link

👍

@aheckmann
Copy link
Collaborator Author

closed via c328227...master

@gjergjie
Copy link

I don't see this implemented on 3.7, still see the old error formatting!

@daslicht
Copy link

so are there any examples ?

@denizozger
Copy link

An example would be great..

@crispen-smith
Copy link

I've actually resorted to using a really hacky check against each of the errors in the error object and just setting a binary flag in my template for final output. so a Big +1 from me on some examples.

@vkarpov15
Copy link
Collaborator

There's a basic example in the validation docs but could be improved. Open to PR :) See #2778 to track that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

9 participants