Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

Player not found.

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.      *
AbstractController->createNotFoundException() in src/Controller/Main/PlayerController.php (line 38)
  1.     {
  2.         $entityManager $this->getEntityManager();
  3.         $playerRepository $entityManager->getRepository('App:Player');
  4.         $player $playerRepository->findOneByUsername($username);
  5.         if (!$player) {
  6.             throw $this->createNotFoundException('Player not found.');
  7.         }
  8.         // TODO figure out how to determine if user is logged in
  9. //        $edit_url = $crudUrlGenerator->build([
  10. //            'entityId' => $player->getId()
  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::MASTER_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.     }
Kernel->handle() in public/index.php (line 28)
  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);

Logs

No log messages

Stack Trace

NotFoundHttpException

Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
Player not found.

  at vendor/symfony/framework-bundle/Controller/AbstractController.php:301
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createNotFoundException()
     (src/Controller/Main/PlayerController.php:38)
  at App\Controller\Main\PlayerController->player()
     (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:195)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:28)