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

Customizing Error Message ? #1

Closed
daslicht opened this issue Aug 17, 2013 · 2 comments
Closed

Customizing Error Message ? #1

daslicht opened this issue Aug 17, 2013 · 2 comments
Assignees
Labels

Comments

@daslicht
Copy link

Hi, is there a way to change the error Message ?

Cheers Marc

@ghost ghost assigned blakehaswell Aug 18, 2013
@blakehaswell
Copy link
Collaborator

So far as I can tell Mongoose doesn’t care about building custom error messages. I don’t want to write code for custom error messages if Mongoose doesn’t have a mechanism for building them.

I found this pull request where custom error messages were discussed: Automattic/mongoose#753. Unfortunately, it looks like that PR is dead.


That said, it should be reasonably simple to build your own mechanism for mapping Mongoose errors to error messages using the path and type fields or the error objects.

@daslicht
Copy link
Author

:/ thanks

blakehaswell pushed a commit that referenced this issue Aug 29, 2014
Allows custom message for each path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants