Skip to content

Commit c4f2899

Browse files
committed
minor #19310 Make the exception message more clear. (Nyholm)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #19310). Discussion ---------- Make the exception message more clear. | Q | A | ------------- | --- | Branch? | "master" | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | A small change that makes the error message more clear. If your property is named "type", "value" or something similar it is not obvious that we refer to the property name. See example: schmittjoh/JMSTranslationBundle#373 Commits ------- 6344ccd Make the exception message more clear.
2 parents 41d6758 + 6344ccd commit c4f2899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Validator/Mapping/PropertyMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PropertyMetadata extends MemberMetadata
3939
public function __construct($class, $name)
4040
{
4141
if (!property_exists($class, $name)) {
42-
throw new ValidatorException(sprintf('Property %s does not exist in class %s', $name, $class));
42+
throw new ValidatorException(sprintf('Property "%s" does not exist in class "%s"', $name, $class));
4343
}
4444

4545
parent::__construct($class, $name, $name);

0 commit comments

Comments
 (0)