From a11ec3e71c2dede1b8fd8861ba621307d9c57752 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 8 Apr 2012 12:53:35 +0200 Subject: [PATCH] [TwigBundle] added correct file name in twig:lint exception reporting --- src/Symfony/Bundle/TwigBundle/Command/LintCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php index ff5f37b6c0..8279f2221d 100644 --- a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php +++ b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php @@ -90,8 +90,8 @@ EOF foreach ($files as $file) { try { $twig->parse($twig->tokenize(file_get_contents($file))); - } catch (\Exception $e) { - $output->writeln(sprintf('Syntax error in %s', $file)); + } catch (\Twig_Error $e) { + $e->setTemplateFile((string) $file); throw $e; }