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; }