Преглед изворни кода

fixing undefined variable name, and removing unexisting namespace. I backtraced code to the actal mongodb maping clas and it doesn't seem to throw any exceptions, but just in case I'm catching the general \Exception

Miha Vrhovnik пре 14 година
родитељ
комит
e9e0f9f102

+ 2 - 3
src/Symfony/Bundle/DoctrineMongoDBBundle/Command/InfoDoctrineODMCommand.php

@@ -11,7 +11,6 @@
 
 namespace Symfony\Bundle\DoctrineMongoDBBundle\Command;
 
-use Doctrine\ODM\MongoDB\Mapping\MappingException;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
@@ -59,7 +58,7 @@ EOT
                                           ->getMetadataDriverImpl()
                                           ->getAllClassNames();
 
-        if (!$entityClassNames) {
+        if (!$documentClassNames) {
             throw new \Exception(
                 'You do not have any mapped Doctrine MongoDB ODM documents for any of your bundles. '.
                 'Create a class inside the Document namespace of any of your bundles and provide '.
@@ -75,7 +74,7 @@ EOT
             try {
                 $cm = $documentManager->getClassMetadata($documentClassName);
                 $output->write("<info>[OK]</info>   " . $documentClassName, true);
-            } catch(MappingException $e) {
+            } catch(\Exception $e) {
                 $output->write("<error>[FAIL]</error> " . $documentClassName, true);
                 $output->write("<comment>" . $e->getMessage()."</comment>", true);
                 $output->write("", true);