It would be nice in my opinion to be able from the validator errors to know what kind of assertion has been done to generate that error.
For example, we've inserted to the User entity an email field with value 'somebadvalue'. If we're displaying a form that's ok since it automatically shows the error in the right place and the user knows about it.
But if we manually validate the User entity, using the validation service, we've just a bunch of errors that doesn't let us know which kind of assertion has been done in an unique way.
We can just match the message but it's easy to be wrong checking only that. It would be nice to add the assertion object or at least the assertion class name, what you guys think?
The ConstraintViolation returned by the validator contains the propertyPath where the violation happens: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/ConstraintViolation.php#L49
Note that this is how the form error can be mapped to the right field
It will just let you know which field has errors, not which assertion failed
Thank you for reporting this issue! This seems to be a duplicate of #7273.