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

[FrameworkBundle] clarified exception message in InitBundleCommand.php (patch from mvrhov)

Fabien Potencier пре 14 година
родитељ
комит
aa1cb87f60
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

+ 4 - 1
src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

@@ -58,7 +58,10 @@ class InitBundleCommand extends Command
         $bundle = basename($tmp);
 
         if (!isset($dirs[$namespace])) {
-            throw new \InvalidArgumentException(sprintf('Unable to initialize the bundle (%s not defined).', $namespace));
+            throw new \InvalidArgumentException(sprintf(
+                "Unable to initialize the bundle (%s is not a defined namespace).\n" .
+                "Defined namespaces are: %s",
+                $namespace, implode(', ', array_keys($dirs))));
         }
 
         $dir = $dirs[$namespace];