diff --git a/Twig/Loader/FilesystemLoader.php b/Twig/Loader/FilesystemLoader.php index d04bacd..93fae48 100644 --- a/Twig/Loader/FilesystemLoader.php +++ b/Twig/Loader/FilesystemLoader.php @@ -71,16 +71,17 @@ protected function findTemplate($template, $throw = true) $file = null; $previous = null; + try { - $file = parent::findTemplate((string) $template); - } catch (\Twig_Error_Loader $e) { + $template = $this->parser->parse($template); + $file = $this->locator->locate($template); + } catch (\Exception $e) { $previous = $e; // for BC try { - $template = $this->parser->parse($template); - $file = $this->locator->locate($template); - } catch (\Exception $e) { + $file = parent::findTemplate((string) $template); + } catch (\Twig_Error_Loader $e) { $previous = $e; } }