Skip to content

Commit a80afcb

Browse files
Fix exception messages containing exception messages
1 parent 2e78223 commit a80afcb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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;

Mapping/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function parseFile($path)
124124
try {
125125
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
126126
} catch (ParseException $e) {
127-
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML', $path).': '.$e->getMessage(), 0, $e);
127+
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: ', $path).$e->getMessage(), 0, $e);
128128
} finally {
129129
restore_error_handler();
130130
}

0 commit comments

Comments
 (0)