Browse Source

Throw a Mustachey runtime exception from filesystem source.

Fixes #370
Justin Hileman 4 years ago
parent
commit
799c0f40fd

+ 2 - 2
src/Mustache/Source/FilesystemSource.php

@@ -38,7 +38,7 @@ class Mustache_Source_FilesystemSource implements Mustache_Source
     /**
     /**
      * Get the Source key (used to generate the compiled class name).
      * Get the Source key (used to generate the compiled class name).
      *
      *
-     * @throws RuntimeException when a source file cannot be read
+     * @throws Mustache_Exception_RuntimeException when a source file cannot be read
      *
      *
      * @return string
      * @return string
      */
      */
@@ -54,7 +54,7 @@ class Mustache_Source_FilesystemSource implements Mustache_Source
             }
             }
 
 
             if ($this->stat === false) {
             if ($this->stat === false) {
-                throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName));
+                throw new Mustache_Exception_RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName));
             }
             }
 
 
             foreach ($this->statProps as $prop) {
             foreach ($this->statProps as $prop) {

+ 1 - 1
test/Mustache/Test/Source/FilesystemSourceTest.php

@@ -15,7 +15,7 @@
 class Mustache_Test_Source_FilesystemSourceTest extends PHPUnit_Framework_TestCase
 class Mustache_Test_Source_FilesystemSourceTest extends PHPUnit_Framework_TestCase
 {
 {
     /**
     /**
-     * @expectedException RuntimeException
+     * @expectedException Mustache_Exception_RuntimeException
      */
      */
     public function testMissingTemplateThrowsException()
     public function testMissingTemplateThrowsException()
     {
     {