Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

Mieszkanie nie zostało znalezione

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.      *
  2.      *     throw $this->createNotFoundException('Page not found!');
  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.      *
  1.     private function resolveApartment(Request $request): Apartment
  2.     {
  3.         $apartment $this->apartmentFromRequestResolver->resolve($request);
  4.         if (null === $apartment) {
  5.             throw $this->createNotFoundException('Mieszkanie nie zostało znalezione');
  6.         }
  7.         return $apartment;
  8.     }
  9. }
  1.     public function apartmentDownloadDetailsPdf(
  2.         Request $request,
  3.         StorageInterface $storage
  4.     ): BinaryFileResponse {
  5.         $apartment $this->resolveApartment($request);
  6.         if (null === $apartment->getDetailsPdf()->getName()) {
  7.             throw $this->createNotFoundException(
  8.                 'Karta mieszkań dla tego mieszkania nie została dodana'
  9.             );
in vendor/symfony/http-kernel/HttpKernel.php -> apartmentDownloadDetailsPdf (line 157)
  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.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  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.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/osiedletatarak/webapps/osiedletatarak/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

No log messages

Stack Trace

NotFoundHttpException
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
Mieszkanie nie zostało znalezione

  at vendor/symfony/framework-bundle/Controller/AbstractController.php:333
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createNotFoundException()
     (bundles/codeplace/RealEstate/FrontendBundle/src/Controller/RealEstate/InvestmentController.php:184)
  at Codeplace\RealEstate\FrontendBundle\Controller\RealEstate\InvestmentController->resolveApartment()
     (bundles/codeplace/RealEstate/FrontendBundle/src/Controller/RealEstate/InvestmentController.php:160)
  at Codeplace\RealEstate\FrontendBundle\Controller\RealEstate\InvestmentController->apartmentDownloadDetailsPdf()
     (vendor/symfony/http-kernel/HttpKernel.php:157)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:199)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:37)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/osiedletatarak/webapps/osiedletatarak/vendor/autoload_runtime.php')
     (public/index.php:5)