Skip to content

Commit b80f474

Browse files
Merge branch '3.4' into 4.4
* 3.4: Fix exception messages containing exception messages
2 parents 1effc73 + a80afcb commit b80f474

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Constraints/AbstractComparisonValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function validate($value, Constraint $constraint)
5555
try {
5656
$comparedValue = $this->getPropertyAccessor()->getValue($object, $path);
5757
} catch (NoSuchPropertyException $e) {
58-
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: '.$e->getMessage(), $path, \get_class($constraint)), 0, $e);
58+
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, \get_class($constraint)).$e->getMessage(), 0, $e);
5959
}
6060
} else {
6161
$comparedValue = $constraint->value;

Constraints/BicValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function validate($value, Constraint $constraint)
138138
try {
139139
$iban = $this->getPropertyAccessor()->getValue($object, $path);
140140
} catch (NoSuchPropertyException $e) {
141-
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: '.$e->getMessage(), $path, \get_class($constraint)), 0, $e);
141+
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, \get_class($constraint)).$e->getMessage(), 0, $e);
142142
}
143143
}
144144
if (!$iban) {

Constraints/RangeValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private function getLimit($propertyPath, $default, Constraint $constraint)
157157
try {
158158
return $this->getPropertyAccessor()->getValue($object, $propertyPath);
159159
} catch (NoSuchPropertyException $e) {
160-
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: '.$e->getMessage(), $propertyPath, \get_class($constraint)), 0, $e);
160+
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, \get_class($constraint)).$e->getMessage(), 0, $e);
161161
}
162162
}
163163

Mapping/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private function parseFile(string $path): array
114114
try {
115115
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
116116
} catch (ParseException $e) {
117-
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML', $path).': '.$e->getMessage(), 0, $e);
117+
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: ', $path).$e->getMessage(), 0, $e);
118118
}
119119

120120
// empty file

0 commit comments

Comments
 (0)