Simplified everything

This commit is contained in:
Javier Eguiluz 2016-03-01 15:47:09 +01:00
parent 19bfa2ed8c
commit 0134d76785
1 changed files with 2 additions and 4 deletions

View File

@ -77,20 +77,18 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
try {
$file = parent::findTemplate($logicalName);
} catch (\Twig_Error_Loader $e) {
$previous = $e;
$errorMessage = $e->getMessage();
$twigLoaderException = $e;
// for BC
try {
$template = $this->parser->parse($template);
$file = $this->locator->locate($template);
} catch (\Exception $e) {
$previous = $e;
}
}
if (false === $file || null === $file) {
throw new \Twig_Error_Loader($errorMessage, -1, null, $previous);
throw $twigLoaderException;
}
return $this->cache[$logicalName] = $file;