[FrameworkBundle] Adding check for invalid form type for better exception message

This commit is contained in:
Ryan Weaver 2011-04-21 19:51:10 -05:00
parent c58b05a6d6
commit fb4eb9c2e9

View File

@ -28,7 +28,9 @@ class ContainerAwareTypeLoader implements TypeLoaderInterface
public function getType($identifier)
{
// TODO check whether identifier exists
if (!isset($this->serviceIds[$identifier])) {
throw new \InvalidArgumentException(sprintf('The field type "%s" is not registered with the service container.', $identifier));
}
return $this->container->get($this->serviceIds[$identifier]);
}