Skip to content

Commit

Permalink
TASK: Error handling: Dont print out eel expression again (if ParserE…
Browse files Browse the repository at this point in the history
…xception)
  • Loading branch information
mhsdesign committed May 22, 2023
1 parent b44c9f3 commit 7d45012
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Service/EelEvaluationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Flowpack\NodeTemplates\Service;

use Neos\Eel\ParserException;
use Neos\Flow\Annotations as Flow;
use Neos\Eel\Utility as EelUtility;
use Neos\Eel\CompilingEvaluator;
Expand Down Expand Up @@ -44,8 +45,10 @@ public function evaluateEelExpression($expression, $contextVariables)
$contextVariables = array_merge($this->defaultContextVariables, $contextVariables);
try {
return EelUtility::evaluateEelExpression($expression, $this->eelEvaluator, $contextVariables);
} catch (ParserException $parserException) {
throw new \RuntimeException('EEL Expression in NodeType template could not be parsed.', 1684788574212, $parserException);
} catch (\Exception $exception) {
throw new \Exception(sprintf('EEL Expression "%s" in NodeType template caused an error.', $expression), 1684761760723, $exception);
throw new \RuntimeException(sprintf('EEL Expression "%s" in NodeType template caused an error.', $expression), 1684761760723, $exception);
}
}
}

0 comments on commit 7d45012

Please sign in to comment.