Skip to content

Commit

Permalink
TASK: 2nd. Fixup for pr #4641 ContentCollection.feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 2, 2023
1 parent ddafc93 commit 9515cbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Neos\Fusion\Core\FusionSourceCodeCollection;
use Neos\Fusion\Core\Parser;
use Neos\Fusion\Core\RuntimeFactory;
use Neos\Fusion\Exception\RuntimeException;
use Neos\Neos\Domain\Service\ContentContext;
use Neos\Neos\Routing\RequestUriHostMiddleware;
use PHPUnit\Framework\Assert;
Expand Down Expand Up @@ -131,7 +132,11 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string
try {
$this->renderingResult = $fusionRuntime->render($path);
} catch (\Throwable $exception) {
$this->lastRenderingException = $exception;
if ($exception instanceof RuntimeException) {
$this->lastRenderingException = $exception->getPrevious();
} else {
$this->lastRenderingException = $exception;
}
}
$fusionRuntime->popContext();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype
include: resource://Neos.Fusion/Private/Fusion/Root.fusion
include: resource://Neos.Neos/Private/Fusion/Root.fusion
test = Neos.Neos:ContentCollection
test = Neos.Neos:ContentCollection {
@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler'
}
"""
Then I expect the following Fusion rendering error:
"""
Expand All @@ -48,6 +50,7 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype
test = Neos.Neos:ContentCollection {
nodePath = 'invalid'
@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler'
}
"""
Then I expect the following Fusion rendering error:
Expand Down

0 comments on commit 9515cbd

Please sign in to comment.