1
0
mirror of synced 2024-12-05 03:06:05 +03:00

#1228 DDC-3490 - avoid catching unknown exceptions, remove unused method call

This commit is contained in:
Marco Pivetta 2015-01-18 01:05:36 +01:00
parent 1cd03625a5
commit b1d7a057fd

View File

@ -728,11 +728,7 @@ class UnitOfWork implements PropertyChangedListener
continue;
}
try {
$this->computeAssociationChanges($assoc, $val);
} catch (\Exception $ex) {
throw ORMInvalidArgumentException::computeAssociationChangesError($entity, $assoc['fieldName'], $val);
}
$this->computeAssociationChanges($assoc, $val);
if ( ! isset($this->entityChangeSets[$oid]) &&
$assoc['isOwningSide'] &&
@ -2203,9 +2199,7 @@ class UnitOfWork implements PropertyChangedListener
break;
case ($relatedEntities !== null):
$targetClass = $this->em->getClassMetadata($assoc['targetEntity'])->name;
if (! $relatedEntities instanceof $targetClass) {
if (! $relatedEntities instanceof $assoc['targetEntity']) {
throw ORMInvalidArgumentException::invalidAssociation(
$this->em->getClassMetadata($assoc['targetEntity']),
$assoc,