From c78024394e2c4ab6ec8dddac446c4105d9e5c7e8 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Fri, 6 Oct 2023 15:25:27 +0200 Subject: [PATCH] Better log of twig syntax errors --- sources/Application/TwigBase/Controller/Controller.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/Application/TwigBase/Controller/Controller.php b/sources/Application/TwigBase/Controller/Controller.php index 87763a40a..954c31938 100644 --- a/sources/Application/TwigBase/Controller/Controller.php +++ b/sources/Application/TwigBase/Controller/Controller.php @@ -35,6 +35,7 @@ use ReflectionClass; use SetupPage; use SetupUtils; use Twig\Error\Error; +use Twig\Error\SyntaxError; use utils; use WebPage; use ZipArchive; @@ -662,6 +663,9 @@ abstract class Controller extends AbstractController { return $this->m_oTwig->render($sName.'.'.$sTemplateFileExtension.'.twig', $aParams); } + catch (SyntaxError $e) { + IssueLog::Error($e->getMessage().' - file: '.$e->getFile().'('.$e->getLine().')'); + } catch (Error $e) { if (strpos($e->getMessage(), 'Unable to find template') === false) {