-
Notifications
You must be signed in to change notification settings - Fork 31
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
Proposal for a new hook #75
Comments
I propose this pull for the base feature of having a hook specific for failed data validation flow #76 |
Hi @lmasarati, sorry it took that long to reply. I've checked your PR and I have to reject it, because following this logic Raisin might end up having many-many other different hooks for a lot of other events. I can think of two possible solutions at the moment, though both of a similar kind:
|
Thanks. Part 2 of the solution should be a good start. Developing a custom Middleware would not be a problem if Raisin publishes the result of validation in some environment variables. |
about hooks in general, there's no way to force an immediate response from inside a hook.
The hook is then responsible for preparing the status, body, headers etc and returning 1 for forcing an immediate response to caller. |
I would find useful to add a new hook to be called in case of failed validation, to allow for modification of headers, content body before a standard 400 Bad Request response is returned.
It is clear to me how to add such a hook, but not how to get validation errors that now are logged on STDERR.
The text was updated successfully, but these errors were encountered: