• Snelle en veilige levering binnen 2 werkdagen
  • Gratis verzending boven 50 euro*
  • Gratis afhalen in 1 van onze winkels
  • Klanten geven ToyChamp een 8.3/10
Page Not Found (404 Not Found)

Symfony Exception

Page Not Found

Exceptions 2

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.     public function onKernelException(ExceptionEvent $event): void
  2.     {
  3.         $throwable $event->getThrowable();
  4.         if ($throwable instanceof NotValidCurrentPageException) {
  5.             $event->setThrowable(new NotFoundHttpException('Page Not Found'$throwable));
  6.         }
  7.     }
  8. }
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.      * @throws \Exception
  2.      */
  3.     private function handleThrowable(\Throwable $eRequest $requestint $type): Response
  4.     {
  5.         $event = new ExceptionEvent($this$request$type$e);
  6.         $this->dispatcher->dispatch($eventKernelEvents::EXCEPTION);
  7.         // a listener might have replaced the exception
  8.         $e $event->getThrowable();
  9.         if (!$event->hasResponse()) {
in vendor/symfony/http-kernel/HttpKernel.php -> handleThrowable (line 86)
  1.                 $this->finishRequest($request$type);
  2.                 throw $e;
  3.             }
  4.             return $this->handleThrowable($e$request$type);
  5.         } finally {
  6.             $this->requestStack->pop();
  7.         }
  8.     }
  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 32)
  1.     $kernel = new HttpCacheKernel($kernel);
  2.     //https://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
  3.     Request::enableHttpMethodParameterOverride();
  4. }
  5. $request Request::createFromGlobals();
  6. $response $kernel->handle($request);
  7. $response->send();
  8. $kernel->terminate($request$response);

Pagerfanta\Exception\ OutOfRangeCurrentPageException

Page "17" does not exist. The currentPage must be inferior to "12"

  1.     {
  2.         if ($this->getNormalizeOutOfRangePages()) {
  3.             return $this->getNbPages();
  4.         }
  5.         throw new OutOfRangeCurrentPageException(sprintf('Page "%d" does not exist. The currentPage must be inferior to "%d"'$currentPage$this->getNbPages()));
  6.     }
  7.     private function resetForCurrentPageChange(): void
  8.     {
  9.         $this->currentPageResults null;
in vendor/pagerfanta/core/Pagerfanta.php -> normalizeOutOfRangeCurrentPage (line 194)
  1.      * @phpstan-return positive-int
  2.      */
  3.     private function filterOutOfRangeCurrentPage(int $currentPage): int
  4.     {
  5.         if ($this->notAllowedCurrentPageOutOfRange($currentPage)) {
  6.             return $this->normalizeOutOfRangeCurrentPage($currentPage);
  7.         }
  8.         return $currentPage;
  9.     }
in vendor/pagerfanta/core/Pagerfanta.php -> filterOutOfRangeCurrentPage (line 175)
  1.      */
  2.     private function filterCurrentPage(int $currentPage): int
  3.     {
  4.         $this->checkCurrentPage($currentPage);
  5.         return $this->filterOutOfRangeCurrentPage($currentPage);
  6.     }
  7.     /**
  8.      * @throws LessThan1CurrentPageException if the current page is less than 1
  9.      */
in vendor/pagerfanta/core/Pagerfanta.php -> filterCurrentPage (line 162)
  1.      * @throws LessThan1CurrentPageException  if the current page is less than 1
  2.      * @throws OutOfRangeCurrentPageException if It is not allowed out of range pages and they are not normalized
  3.      */
  4.     public function setCurrentPage(int $currentPage): PagerfantaInterface
  5.     {
  6.         $this->currentPage $this->filterCurrentPage($currentPage);
  7.         $this->resetForCurrentPageChange();
  8.         return $this;
  9.     }
Pagerfanta->setCurrentPage(17) in src/View/Product/ProductVariantCollectionView.php (line 77)
  1.     }
  2.     public function getFilteredView(PagerfantaInterface $pagerfantaProductListFilter $filterChannel $channel): array
  3.     {
  4.         $pagerfanta->setMaxPerPage($filter->getProductsPerPage())
  5.             ->setCurrentPage($filter->getPage());
  6.         /** @var ProductVariant[] $productVariants */
  7.         $productVariants array_map(
  8.             function (ProductVariantTranslation $productVariantTranslation): ProductVariant {
  9.                 /** @var ProductVariant $variant PHPSTAN */
ProductVariantCollectionView->getFilteredView(object(ElasticSearchPager), object(ProductListFilter), object(Channel)) in src/Controller/Front/PageContent/ProductListBlockController.php (line 109)
  1.         }
  2.         if ($request->attributes->has('title')) {
  3.             $title $this->translator->trans($request->attributes->get('title'));
  4.         }
  5.         $products $this->productCollectionView->getFilteredView($results$productListFilter$channel);
  6.         $routeName $request->query->get('routeName'EsiPaginationRouteGenerator::QUERY_PARAM_ONLY_ROUTE);
  7.         /**
  8.          * @var array|bool|float|int|string|null $routeParams
  9.          */
  10.         $routeParams $request->query->get('routeParams') ?? [];
in vendor/symfony/http-kernel/HttpKernel.php -> renderBlock (line 163)
  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 32)
  1.     $kernel = new HttpCacheKernel($kernel);
  2.     //https://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
  3.     Request::enableHttpMethodParameterOverride();
  4. }
  5. $request Request::createFromGlobals();
  6. $response $kernel->handle($request);
  7. $response->send();
  8. $kernel->terminate($request$response);

Logs

No log messages

Stack Traces 2

[2/2] NotFoundHttpException
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
Page Not Found

  at vendor/babdev/pagerfanta-bundle/src/EventListener/ConvertNotValidCurrentPageToNotFoundListener.php:16
  at BabDev\PagerfantaBundle\EventListener\ConvertNotValidCurrentPageToNotFoundListener->onKernelException(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(ExceptionEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception')
     (vendor/symfony/http-kernel/HttpKernel.php:223)
  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(OutOfRangeCurrentPageException), object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:86)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:32)                
[1/2] OutOfRangeCurrentPageException
Pagerfanta\Exception\OutOfRangeCurrentPageException:
Page "17" does not exist. The currentPage must be inferior to "12"

  at vendor/pagerfanta/core/Pagerfanta.php:221
  at Pagerfanta\Pagerfanta->normalizeOutOfRangeCurrentPage(17)
     (vendor/pagerfanta/core/Pagerfanta.php:194)
  at Pagerfanta\Pagerfanta->filterOutOfRangeCurrentPage(17)
     (vendor/pagerfanta/core/Pagerfanta.php:175)
  at Pagerfanta\Pagerfanta->filterCurrentPage(17)
     (vendor/pagerfanta/core/Pagerfanta.php:162)
  at Pagerfanta\Pagerfanta->setCurrentPage(17)
     (src/View/Product/ProductVariantCollectionView.php:77)
  at App\View\Product\ProductVariantCollectionView->getFilteredView(object(ElasticSearchPager), object(ProductListFilter), object(Channel))
     (src/Controller/Front/PageContent/ProductListBlockController.php:109)
  at App\Controller\Front\PageContent\ProductListBlockController->renderBlock(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:32)                
Naar boven

We respecteren uw privacy!

We gebruiken technologieën, zoals cookies, om uw surfervaring makkelijker te maken, om socialemediafuncties te bieden en om het verkeer op de website te analyseren. Ook delen we informatie over je gebruik van onze website met onze vertrouwde socialemedia-, en analysepartners.

Privacy policy