Browse Source

[HttpKernel] Added some details for two commonly encountered errors in Kernel.php and HttpKernel.php

I used https://github.com/fabpot/symfony/blob/master/src/Symfony/Component/Form/PropertyPath.php#L324 as a model for the wording
Fabrice Bernhard 14 years ago
parent
commit
20e31cd3f2

+ 1 - 1
src/Symfony/Component/HttpKernel/HttpKernel.php

@@ -89,7 +89,7 @@ class HttpKernel implements HttpKernelInterface
 
 
         // load controller
         // load controller
         if (false === $controller = $this->resolver->getController($request)) {
         if (false === $controller = $this->resolver->getController($request)) {
-            throw new NotFoundHttpException(sprintf('Unable to find the controller for "%s", check your route configuration.', $request->getPathInfo()));
+            throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo()))
         }
         }
 
 
         $event = new Event($this, 'core.controller', array('request_type' => $type, 'request' => $request));
         $event = new Event($this, 'core.controller', array('request_type' => $type, 'request' => $request));

+ 1 - 1
src/Symfony/Component/HttpKernel/Kernel.php

@@ -186,7 +186,7 @@ abstract class Kernel implements KernelInterface
     public function getBundle($name, $first = true)
     public function getBundle($name, $first = true)
     {
     {
         if (!isset($this->bundleMap[$name])) {
         if (!isset($this->bundleMap[$name])) {
-            throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled.', $name));
+            throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your %s.php file?', $name, get_class($this)));
         }
         }
 
 
         if (true === $first) {
         if (true === $first) {