Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

The news does not exist

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/Troika/RealEstateBundle/Controller/DefaultController.php (line 440)
  1.     {
  2.         $news $this->container->get('news.model')->getSlug($slug$id);
  3.         $links $this->container->get('news.model')->getPage(1);
  4.         if (!$news) {
  5.             throw $this->createNotFoundException('The news does not exist');
  6.         }
  7.         return $this->render('TroikaRealEstateBundle:About:news_item.html.twig', ['news' => $news'links' => $links]);
  8.     }
in vendor/symfony/http-kernel/HttpKernel.php->newsItemSlugAction (line 169)
  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() in web/app.php (line 52)
  1. // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
  2. //Request::enableHttpMethodParameterOverride();
  3.     $request Request::createFromGlobals();
  4.     try {
  5.         $response $kernel->handle($requestHttpKernelInterface::MASTER_REQUESTtrue); //$dev
  6.     } catch (Exception $e) {
  7.         if ($dev) {
  8.             if (property_exists($e'xdebug_message')) {
  9.                 $message $e->xdebug_message;
  10.             } else {

Logs 1

Level Channel Message
ERROR 02:31:03 request Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "The news does not exist" at /home/troikaestate/public_html/vendor/symfony/framework-bundle/Controller/ControllerTrait.php line 294
{
    "exception": {
        "xdebug_message": "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: The news does not exist in /home/troikaestate/public_html/vendor/symfony/framework-bundle/Controller/ControllerTrait.php on line <i>294</i></th></tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0001</td><td bgcolor='#eeeeec' align='right'>360720</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>0</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0034</td><td bgcolor='#eeeeec' align='right'>407120</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\Kernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $requestUri = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>52</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0766</td><td bgcolor='#eeeeec' align='right'>1100520</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $requestUri = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/Kernel.php' bgcolor='#eeeeec'>.../Kernel.php<b>:</b>201</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0766</td><td bgcolor='#eeeeec' align='right'>1101312</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $requestUri = &#39;/news/vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova-204&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>81</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1102</td><td bgcolor='#eeeeec' align='right'>1693240</td><td bgcolor='#eeeeec'>Troika\\RealEstateBundle\\Controller\\DefaultController->newsItemSlugAction( <span>$slug = </span><span>&#39;vizitnaya_kartochka_eksperta_po_nedvizhimosti_anna_tyurnikova&#39;</span>, <span>$id = </span><span>&#39;204&#39;</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>169</td></tr>\n"
    }
}

Stack Trace

NotFoundHttpException

Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
The news does not exist

  at vendor/symfony/framework-bundle/Controller/ControllerTrait.php:294
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createNotFoundException()
     (src/Troika/RealEstateBundle/Controller/DefaultController.php:440)
  at Troika\RealEstateBundle\Controller\DefaultController->newsItemSlugAction()
     (vendor/symfony/http-kernel/HttpKernel.php:169)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web/app.php:52)