From 0134d7678516f6c9ec56059e0596685c501724b4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 1 Mar 2016 15:47:09 +0100 Subject: [PATCH] Simplified everything --- src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php index e3170aff94..2a21c30fba 100644 --- a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php @@ -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;