Skip to content

Commit

Permalink
Fix the translation commands when a template contains a syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 29, 2019
1 parent fa783f9 commit 3ae5d17
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Symfony/Bridge/Twig/Translation/TwigExtractor.php
Expand Up @@ -58,13 +58,7 @@ public function extract($resource, MessageCatalogue $catalogue)
try {
$this->extractTemplate(file_get_contents($file->getPathname()), $catalogue);
} catch (Error $e) {
if ($file instanceof \SplFileInfo) {
$path = $file->getRealPath() ?: $file->getPathname();
$name = $file instanceof SplFileInfo ? $file->getRelativePathname() : $path;
$e->setSourceContext(new Source('', $name, $path));
}

throw $e;
// ignore errors, these should be fixed by using the linter
}
}
}
Expand Down

0 comments on commit 3ae5d17

Please sign in to comment.