Exceptions
NotFoundHttpException
HTTP 404 Not Found
Stack Trace
* * throw $this->createNotFoundException('Page not found!'); */protected function createNotFoundException(string $message = 'Not Found', ?\Throwable $previous = null): NotFoundHttpException{ return new NotFoundHttpException($message, $previous);}/** * Returns an AccessDeniedException. *
AbstractController->createNotFoundException()
in
src/Media/Controller/MediaFileController.php
(line 33)
// Une seule URL par fichier : un nom différent redirige vers le nom actuel.if ($filename !== $media->getOriginalFilename()) { return $this->redirectToRoute('media_file', ['id' => $media->getId(), 'filename' => $media->getOriginalFilename()], Response::HTTP_MOVED_PERMANENTLY);}if (!$storage->fileExists($media->getStorageKey())) { throw $this->createNotFoundException();}$response = new StreamedResponse(static function () use ($storage, $media): void { $stream = $storage->readStream($media->getStorageKey()); fpassthru($stream);$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) { $event = new ViewEvent($this, $request, $type, $response, $controllerMetadata); $this->dispatcher->dispatch($event, KernelEvents::VIEW);$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try { return $response = $this->handleRaw($request, $type, $controllerMetadata);} catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } if (!$this->handlingHttpCache) { $this->resetServices = true; } try { return $this->getHttpKernel()->handle($request, $type, $catch); } finally { --$this->requestStackSize; }}) {}public function run(): int{ $response = $this->kernel->handle($this->request); $response->send(false); if (\function_exists('fastcgi_finish_request') && !$this->debug) { fastcgi_finish_request();$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return static function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
Not Found
at vendor/symfony/framework-bundle/Controller/AbstractController.php:328
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createNotFoundException()
(src/Media/Controller/MediaFileController.php:33)
at App\Media\Controller\MediaFileController->__invoke()
(vendor/symfony/http-kernel/HttpKernel.php:200)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:80)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:156)
at Symfony\Component\HttpKernel\Kernel->handle()
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/mnt/disk/www/twinjet/vendor/autoload_runtime.php')
(public/index.php:5)