Skip to content

Commit

Permalink
BUGFIX: catch and enhance errors caused in EelExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed May 22, 2023
1 parent 913f28f commit b44c9f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Service/EelEvaluationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public function evaluateEelExpression($expression, $contextVariables)
$this->defaultContextVariables = EelUtility::getDefaultContextVariables($this->defaultContext);
}
$contextVariables = array_merge($this->defaultContextVariables, $contextVariables);
return EelUtility::evaluateEelExpression($expression, $this->eelEvaluator, $contextVariables);
try {
return EelUtility::evaluateEelExpression($expression, $this->eelEvaluator, $contextVariables);
} catch (\Exception $exception) {
throw new \Exception(sprintf('EEL Expression "%s" in NodeType template caused an error.', $expression), 1684761760723, $exception);
}
}

}
}

0 comments on commit b44c9f3

Please sign in to comment.