diff --git a/src/web/SandboxView.php b/src/web/SandboxView.php index 9a020cd..5b9c81b 100644 --- a/src/web/SandboxView.php +++ b/src/web/SandboxView.php @@ -54,6 +54,21 @@ public function createTwig(): Environment return $twig; } + /** + * @inheritDoc + */ + public function renderObjectTemplate(string $template, mixed $object, array $variables = [], string $templateMode = self::TEMPLATE_MODE_SITE): string + { + $result = ''; + try { + $result = parent::renderObjectTemplate($template, $object, $variables, $templateMode); + } catch (\Throwable $e) { + $this->sandboxErrorHandler->handleException($e); + } + + return $result; + } + /** * @inheritDoc */ @@ -68,4 +83,19 @@ public function renderString(string $template, array $variables = [], string $te return $result; } + + /** + * @inheritDoc + */ + public function renderTemplate(string $template, array $variables = [], ?string $templateMode = null): string + { + $result = ''; + try { + $result = parent::renderTemplate($template, $variables, $templateMode); + } catch (\Throwable $e) { + $this->sandboxErrorHandler->handleException($e); + } + + return $result; + } }