From 55f9e6fb9928b95420fd330b17145972c071a00b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 27 Apr 2011 09:49:45 +0200 Subject: [PATCH] [DoctrineBundle] tweaked various exceptions to make it clear that the issue is related to Doctrine --- .../DependencyInjection/AbstractDoctrineExtension.php | 6 +++--- .../DependencyInjection/DoctrineExtension.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php index 145c3f3b8f9e..8bc5d4e232ed 100644 --- a/src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php @@ -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)); } } @@ -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'))) { diff --git a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php index df6d3d2333b7..13fa2330892d 100755 --- a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php +++ b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php @@ -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);