Skip to content

Commit

Permalink
[DoctrineBundle] tweaked various exceptions to make it clear that the…
Browse files Browse the repository at this point in the history
… issue is related to Doctrine
  • Loading branch information
fabpot committed Apr 27, 2011
1 parent 631393e commit 55f9e6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -123,7 +123,7 @@ protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
}
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
} else {
throw new \InvalidArgumentException(sprintf('Invalid mapping path given. Cannot load mapping/bundle named "%s".', $mappingName));
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
}
}

Expand Down Expand Up @@ -225,11 +225,11 @@ protected function registerMappingDrivers($objectManager, ContainerBuilder $cont
protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName)
{
if (!$mappingConfig['type'] || !$mappingConfig['dir'] || !$mappingConfig['prefix']) {
throw new \InvalidArgumentException(sprintf('Mapping definitions for manager "%s" require at least the "type", "dir" and "prefix" options.', $objectManagerName));
throw new \InvalidArgumentException(sprintf('Mapping definitions for Doctrine manager "%s" require at least the "type", "dir" and "prefix" options.', $objectManagerName));
}

if (!file_exists($mappingConfig['dir'])) {
throw new \InvalidArgumentException(sprintf('Specified non-existing directory "%s" as mapping source.', $mappingConfig['dir']));
throw new \InvalidArgumentException(sprintf('Specified non-existing directory "%s" as Doctrine mapping source.', $mappingConfig['dir']));
}

if (!in_array($mappingConfig['type'], array('xml', 'yml', 'annotation', 'php', 'staticphp'))) {
Expand Down
Expand Up @@ -342,7 +342,7 @@ protected function getEntityManagerCacheDefinition(array $entityManager, $cacheD
$cacheDef = new Definition('%'.sprintf('doctrine.orm.cache.%s.class', $cacheDriver['type']).'%');
break;
default:
throw new \InvalidArgumentException(sprintf('%s is unrecognized cache driver.', $cacheDriver['type']));
throw new \InvalidArgumentException(sprintf('"%s" is an unrecognized Doctrine cache driver.', $cacheDriver['type']));
}

$cacheDef->setPublic(false);
Expand Down

0 comments on commit 55f9e6f

Please sign in to comment.