Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

Not Found

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.      *
  2.      * @final
  3.      */
  4.     protected function createNotFoundException(string $message 'Not Found', \Throwable $previous null): NotFoundHttpException
  5.     {
  6.         return new NotFoundHttpException($message$previous);
  7.     }
  8.     /**
  9.      * Returns an AccessDeniedException.
  10.      *
AbstractController->createNotFoundException() in src/Controller/ProductsController.php (line 167)
  1.         return $return;
  2.     }
  3.     private function showIndex() {
  4.         if (!$this->isGranted('ROLE_ADMIN')) {
  5.             throw $this->createNotFoundException();
  6.         }
  7.         $categories1 $this->getDoctrine()->getRepository(ProductsCat::class)->findBy(array('parentId' => NULL), array('position' => 'ASC'));
  8.         echo '<ul>';
  9.         foreach ($categories1 as $category1) {
  10.             echo '<li>';
ProductsController->showIndex() in src/Controller/ProductsController.php (line 160)
  1.         } else if ($template == 'category') {
  2.             $return $this->showCategory($category);
  3.         } else if ($template == 'product') {
  4.             $return $this->showProduct($category$product);
  5.         } else {
  6.             $return $this->showIndex();
  7.         }
  8.         return $return;
  9.     }
  10.     private function showIndex() {
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle(object(Request)) in public/index.php (line 29)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Stack Trace

NotFoundHttpException

Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
Not Found

  at vendor/symfony/framework-bundle/Controller/ControllerTrait.php:294
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createNotFoundException()
     (src/Controller/ProductsController.php:167)
  at App\Controller\ProductsController->showIndex()
     (src/Controller/ProductsController.php:160)
  at App\Controller\ProductsController->index(object(Request), 'clinical-chemistry', 'parameters', 'alpha-hydroxybutyrate-dehydrogenase', 'accent-300-hbdh', null, object(Translator))
     (vendor/symfony/http-kernel/HttpKernel.php:169)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:29)