Throw Kohana_Exception when Mustache template file not found
This commit is contained in:
parent
d144462a32
commit
74841f65ac
|
@ -30,6 +30,12 @@ class Mustache_Loader_Kohana implements Mustache_Loader, Mustache_Loader_Mutable
|
|||
protected function _load_file($name)
|
||||
{
|
||||
$filename = Kohana::find_file($this->_base_dir, $name, $this->_extension);
|
||||
|
||||
if ( ! $filename)
|
||||
{
|
||||
throw new Kohana_Exception('Mustache template ":name" not found', array(':name' => $name));
|
||||
}
|
||||
|
||||
return file_get_contents($filename);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue