Improve phrasing on exception message instead of trying to fix callers
This commit is contained in:
parent
b8ef3af982
commit
0ade3aa62a
@ -65,7 +65,7 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
|
||||
static public function entityWithoutIdentity($className, $entity)
|
||||
{
|
||||
return new self(
|
||||
"The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " .
|
||||
"The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " .
|
||||
"id values set. It cannot be added to the identity map."
|
||||
);
|
||||
}
|
||||
@ -154,7 +154,7 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
|
||||
*/
|
||||
static public function detachedEntityCannot($entity, $operation)
|
||||
{
|
||||
return new self("A detached entity was found during " . $operation . " " . self::objToStr($entity));
|
||||
return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1655,7 +1655,7 @@ class UnitOfWork implements PropertyChangedListener
|
||||
|
||||
case self::STATE_DETACHED:
|
||||
// Can actually not happen right now since we assume STATE_NEW.
|
||||
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persist");
|
||||
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
|
||||
|
||||
default:
|
||||
throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
|
||||
@ -1726,7 +1726,7 @@ class UnitOfWork implements PropertyChangedListener
|
||||
break;
|
||||
|
||||
case self::STATE_DETACHED:
|
||||
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "remove");
|
||||
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
|
||||
default:
|
||||
throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user