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

afterValidate hook is not called when validation fails #1626

Closed
alekbarszczewski opened this issue Apr 11, 2014 · 3 comments
Closed

afterValidate hook is not called when validation fails #1626

alekbarszczewski opened this issue Apr 11, 2014 · 3 comments
Labels
type: feature For issues and PRs. For new features. Never breaking changes.

Comments

@alekbarszczewski
Copy link
Contributor

When validation errors occur (for example during Model.create(...) then afterValidate hook is not called. It would be a good feature to be able to catch validation errors in a hook - is it possible?

If not maybe you could implement this functionality in new version?
For example like this:

hooks: { afterValidate: function(model, done) { console.error(model.validationErrors)... } }

or

hooks: { afterValidationFailed: function(err, model, done) { ... } }

or something like this.

@mickhansen
Copy link
Contributor

This would break BC - Although i'm not sure who uses that hook, but you never know.
The problem is also that the signature for that method is still model.

But yeah we could definitely add a validation failed hook i suppose, that wouldn't interfere with anything.

@ptusch
Copy link

ptusch commented Oct 15, 2015

Push

It would be nice to work with failed validation.

@janmeier
Copy link
Member

Added in #5196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature For issues and PRs. For new features. Never breaking changes.
Projects
None yet
Development

No branches or pull requests

4 participants