浏览代码

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
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/Symfony/Bundle/DoctrineMongoDBBundle/Command/InfoDoctrineODMCommand.php

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

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