[TwigBundle] added correct file name in twig:lint exception reporting

This commit is contained in:
Fabien Potencier 2012-04-08 12:53:35 +02:00
parent 57c6aaa397
commit a11ec3e71c

View File

@ -90,8 +90,8 @@ EOF
foreach ($files as $file) {
try {
$twig->parse($twig->tokenize(file_get_contents($file)));
} catch (\Exception $e) {
$output->writeln(sprintf('<error>Syntax error in %s</error>', $file));
} catch (\Twig_Error $e) {
$e->setTemplateFile((string) $file);
throw $e;
}