diff --git a/Constraints/BicValidator.php b/Constraints/BicValidator.php index a2c9f7a41..92b10ae7f 100644 --- a/Constraints/BicValidator.php +++ b/Constraints/BicValidator.php @@ -130,7 +130,7 @@ public function validate($value, Constraint $constraint) try { $iban = $this->getPropertyAccessor()->getValue($object, $path); } catch (NoSuchPropertyException $e) { - throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s.', $path, \get_class($constraint), $e->getMessage()), 0, $e); + throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: '.$e->getMessage(), $path, \get_class($constraint)), 0, $e); } } if (!$iban) { diff --git a/Constraints/RangeValidator.php b/Constraints/RangeValidator.php index 9b7c40ce5..3cfd43f99 100644 --- a/Constraints/RangeValidator.php +++ b/Constraints/RangeValidator.php @@ -157,7 +157,7 @@ private function getLimit($propertyPath, $default, Constraint $constraint) try { return $this->getPropertyAccessor()->getValue($object, $propertyPath); } catch (NoSuchPropertyException $e) { - throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s.', $propertyPath, \get_class($constraint), $e->getMessage()), 0, $e); + throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: '.$e->getMessage(), $propertyPath, \get_class($constraint)), 0, $e); } }