Browse Source

[TwigBundle] Cleaning up several portions of the exception message received when a template cannot be loaded

 * The quotations are redundant when the template is a string - json_encode() adds the quotes
 * The exception should not end in a period, as the exception class may add a line number (not in this case, but generall)
 * Made the line number -1, so that no line number was displayed in the message (error at line 0 looks worse than nothing at all)
Ryan Weaver 14 years ago
parent
commit
22beeb2549
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

+ 1 - 1
src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

@@ -94,7 +94,7 @@ class FilesystemLoader implements \Twig_LoaderInterface
         }
 
         if (false === $file || null === $file) {
-            throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', json_encode($name)), 0, null, $previous);
+            throw new \Twig_Error_Loader(sprintf('Unable to find the template %s', json_encode($name)), -1, null, $previous);
         }
 
         return $this->cache[$key] = $file;