Skip to content

Commit 88b913b

Browse files
committed
Fixed the problem in an easier way
1 parent 35f082f commit 88b913b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected function findTemplate($template, $throw = true)
7878
$file = parent::findTemplate($logicalName);
7979
} catch (\Twig_Error_Loader $e) {
8080
$previous = $e;
81+
$errorMessage = $e->getMessage();
8182

8283
// for BC
8384
try {
@@ -89,14 +90,7 @@ protected function findTemplate($template, $throw = true)
8990
}
9091

9192
if (false === $file || null === $file) {
92-
try {
93-
list($namespace, $name) = $this->parseName($logicalName);
94-
$paths = sprintf(' (looked into: %s)', implode(', ', $this->getPaths($namespace)));
95-
} catch (\Twig_Error_Loader $e) {
96-
$paths = '';
97-
}
98-
99-
throw new \Twig_Error_Loader(sprintf('Unable to find template "%s"%s.', $name, $paths, -1, null, $previous));
93+
throw new \Twig_Error_Loader($errorMessage, -1, null, $previous);
10094
}
10195

10296
return $this->cache[$logicalName] = $file;

0 commit comments

Comments
 (0)