added an exception of a template path does not exist
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 22 Oct 2009 00:44:44 +0000 (00:44 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 22 Oct 2009 00:44:44 +0000 (00:44 +0000)
git-svn-id: http://svn.twig-project.org/trunk@85 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Loader/Filesystem.php

index 8ec795b..fdd1ad8 100644 (file)
@@ -61,6 +61,11 @@ class Twig_Loader_Filesystem extends Twig_Loader
     $this->paths = array();
     foreach ($paths as $path)
     {
+      if (!is_dir($path))
+      {
+        throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $path));
+      }
+
       $this->paths[] = realpath($path);
     }
   }