pageNotFound example

$resolverContext = new EntityResolverContext($context$request$this->categoryDefinition, $category);

        $pages = $this->cmsPageLoader->load(
            $request,
            $this->createCriteria($pageId$request),
            $context,
            $slotConfig,
            $resolverContext
        );

        if (!$pages->has($pageId)) {
            throw CategoryException::pageNotFound($pageId);
        }

        /** @var CmsPageEntity $page */
        $page = $pages->get($pageId);
        $category->setCmsPage($page);
        $category->setCmsPageId($pageId);

        return new CategoryRouteResponse($category);
    }

    private function loadCategory(string $categoryId, SalesChannelContext $context): CategoryEntity
    {
Home | Imprint | This part of the site doesn't use cookies.