Symfony Exception
Exceptions 2
Symfony\Component\HttpKernel\Exception\ NotFoundHttpException
in
vendor/babdev/pagerfanta-bundle/src/EventListener/ConvertNotValidCurrentPageToNotFoundListener.php
(line 16)
public function onKernelException(ExceptionEvent $event): void
{
$throwable = $event->getThrowable();
if ($throwable instanceof NotValidCurrentPageException) {
$event->setThrowable(new NotFoundHttpException('Page Not Found', $throwable));
}
}
}
in
vendor/symfony/event-dispatcher/Debug/WrappedListener.php
->
onKernelException
(line 118)
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
try {
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
__invoke
(line 230)
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
callListeners
(line 59)
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
in
vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
->
dispatch
(line 154)
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
dispatch
(line 223)
* @throws \Exception
*/
private function handleThrowable(\Throwable $e, Request $request, int $type): Response
{
$event = new ExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch($event, KernelEvents::EXCEPTION);
// a listener might have replaced the exception
$e = $event->getThrowable();
if (!$event->hasResponse()) {
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleThrowable
(line 86)
$this->finishRequest($request, $type);
throw $e;
}
return $this->handleThrowable($e, $request, $type);
} finally {
$this->requestStack->pop();
}
}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$kernel = new HttpCacheKernel($kernel);
//https://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
Request::enableHttpMethodParameterOverride();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Pagerfanta\Exception\ OutOfRangeCurrentPageException
in
vendor/pagerfanta/core/Pagerfanta.php
(line 221)
{
if ($this->getNormalizeOutOfRangePages()) {
return $this->getNbPages();
}
throw new OutOfRangeCurrentPageException(sprintf('Page "%d" does not exist. The currentPage must be inferior to "%d"', $currentPage, $this->getNbPages()));
}
private function resetForCurrentPageChange(): void
{
$this->currentPageResults = null;
in
vendor/pagerfanta/core/Pagerfanta.php
->
normalizeOutOfRangeCurrentPage
(line 194)
* @phpstan-return positive-int
*/
private function filterOutOfRangeCurrentPage(int $currentPage): int
{
if ($this->notAllowedCurrentPageOutOfRange($currentPage)) {
return $this->normalizeOutOfRangeCurrentPage($currentPage);
}
return $currentPage;
}
in
vendor/pagerfanta/core/Pagerfanta.php
->
filterOutOfRangeCurrentPage
(line 175)
*/
private function filterCurrentPage(int $currentPage): int
{
$this->checkCurrentPage($currentPage);
return $this->filterOutOfRangeCurrentPage($currentPage);
}
/**
* @throws LessThan1CurrentPageException if the current page is less than 1
*/
in
vendor/pagerfanta/core/Pagerfanta.php
->
filterCurrentPage
(line 162)
* @throws LessThan1CurrentPageException if the current page is less than 1
* @throws OutOfRangeCurrentPageException if It is not allowed out of range pages and they are not normalized
*/
public function setCurrentPage(int $currentPage): PagerfantaInterface
{
$this->currentPage = $this->filterCurrentPage($currentPage);
$this->resetForCurrentPageChange();
return $this;
}
}
public function getFilteredView(PagerfantaInterface $pagerfanta, ProductListFilter $filter, Channel $channel): array
{
$pagerfanta->setMaxPerPage($filter->getProductsPerPage())
->setCurrentPage($filter->getPage());
/** @var ProductVariant[] $productVariants */
$productVariants = array_map(
function (ProductVariantTranslation $productVariantTranslation): ProductVariant {
/** @var ProductVariant $variant PHPSTAN */
ProductVariantCollectionView->getFilteredView(object(ElasticSearchPager), object(ProductListFilter), object(Channel))
in
src/Controller/Front/PageContent/ProductListBlockController.php
(line 109)
}
if ($request->attributes->has('title')) {
$title = $this->translator->trans($request->attributes->get('title'));
}
$products = $this->productCollectionView->getFilteredView($results, $productListFilter, $channel);
$routeName = $request->query->get('routeName', EsiPaginationRouteGenerator::QUERY_PARAM_ONLY_ROUTE);
/**
* @var array|bool|float|int|string|null $routeParams
*/
$routeParams = $request->query->get('routeParams') ?? [];
in
vendor/symfony/http-kernel/HttpKernel.php
->
renderBlock
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$kernel = new HttpCacheKernel($kernel);
//https://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
Request::enableHttpMethodParameterOverride();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$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 "54" does not exist. The currentPage must be inferior to "1" at vendor/pagerfanta/core/Pagerfanta.php:221 at Pagerfanta\Pagerfanta->normalizeOutOfRangeCurrentPage(54) (vendor/pagerfanta/core/Pagerfanta.php:194) at Pagerfanta\Pagerfanta->filterOutOfRangeCurrentPage(54) (vendor/pagerfanta/core/Pagerfanta.php:175) at Pagerfanta\Pagerfanta->filterCurrentPage(54) (vendor/pagerfanta/core/Pagerfanta.php:162) at Pagerfanta\Pagerfanta->setCurrentPage(54) (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) |