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

Recognize Joi errors #335

Closed
paglias opened this issue May 20, 2014 · 4 comments
Closed

Recognize Joi errors #335

paglias opened this issue May 20, 2014 · 4 comments
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@paglias
Copy link

paglias commented May 20, 2014

Is there a way to "recognize" an error returned by Joi?

Maybe changing error.constructor.name to JoiValidationError or something similar

@hueniverse
Copy link
Contributor

Is it enough to just set error.name?

@paglias
Copy link
Author

paglias commented May 23, 2014

@hueniverse yes, it's what I'm using in my own code. It's really a matter of one line of code but I can send a PR if you want, https://github.com/spumko/joi/blob/master/lib/errors.js#L13

@hueniverse
Copy link
Contributor

Do it. Make it ValidationError

@hueniverse hueniverse added this to the 4.4.0 milestone May 24, 2014
@hueniverse hueniverse self-assigned this May 24, 2014
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

2 participants