/**
  * @Flow\Around("method(TYPO3\Neos\Routing\FrontendNodeRoutePartHandler->convertRequestPathToNode())")
  *
  * @param \TYPO3\FLOW\AOP\JoinPointInterface $joinPoint the join point
  *
  * @return mixed
  */
 public function aroundConvertRequestPathToNodeAspect($joinPoint)
 {
     if ($this->nodeNotFoundService->isEnabled()) {
         /** @var NodeInterface $node */
         $requestPath = $joinPoint->getMethodArgument('requestPath');
         try {
             return $joinPoint->getAdviceChain()->proceed($joinPoint);
         } catch (InvalidRequestPathException $e) {
             $defaultUriSegment = $this->nodeNotFoundService->getDefaultUriSegment();
             $requestPath = $defaultUriSegment . $this->nodeNotFoundService->get404NodeUriForDimensionUriSegment($defaultUriSegment);
             $joinPoint->setMethodArgument("requestPath", $requestPath);
             return $joinPoint->getAdviceChain()->proceed($joinPoint);
         } catch (NoSuchDimensionValueException $e) {
             $defaultUriSegment = $this->nodeNotFoundService->getDefaultUriSegment();
             $requestPath = $defaultUriSegment . $this->nodeNotFoundService->get404NodeUriForDimensionUriSegment($defaultUriSegment);
             $joinPoint->setMethodArgument("requestPath", $requestPath);
             return $joinPoint->getAdviceChain()->proceed($joinPoint);
         } catch (NoSuchNodeException $e) {
             $dimensionUriSegment = strstr($requestPath, "/", true);
             if (count($this->contentDimensionPresetSource->getAllPresets()) > 0) {
                 $requestPath = $dimensionUriSegment . "/" . $this->nodeNotFoundService->get404NodeUriForDimensionUriSegment($dimensionUriSegment);
             } else {
                 $requestPath = $this->nodeNotFoundService->get404NodeUriForDimensionUriSegment('');
             }
             $joinPoint->setMethodArgument("requestPath", $requestPath);
             return $joinPoint->getAdviceChain()->proceed($joinPoint);
         }
     } else {
         // execute the original code
         return $joinPoint->getAdviceChain()->proceed($joinPoint);
     }
 }