-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Separate technical and non-technical error messages #546
Comments
I see two potential outcomes:
|
FYI, in symfony such cases generate exceptions not violations (e.g. https://github.com/symfony/validator/blob/6.2/Constraints/BicValidator.php#L69) |
I don't think it is a correct behavior since validator is meant to validate data that could be incorrect, not to throw exceptions. |
Exceptions should only be thrown if the error is not caused by the user input itself, but it is hard to figure out when this is the case. Example: String Validator Max Length=30 gets an array. On a HTML form with a normal input field this can not happen so if this happens we can not tell the user to "please do not enter an array here". This somehow ended up in the program so it should be an exception. But figuring out in which cases to throw an exception or provide validation error is a tricky thing. I'll try to think about possible solutions. |
If that won't happen, why should we worry? |
Two reasons:
|
In case of "little hacker" it's better to additionally log such request |
My thoughts for implementation:
|
Extracted from #492 (comment). This was discussed before. The topic raised again by @cebe.
Related - #526.
The text was updated successfully, but these errors were encountered: