Przeglądaj źródła

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

Fabien Potencier 14 lat temu
rodzic
commit
aa1cb87f60

+ 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];