Better error message when template file isn't found

This commit is contained in:
Matias Griese
2014-08-15 14:47:48 +03:00
parent 0c0cc03394
commit ec8c3d9e60

View File

@@ -233,7 +233,12 @@ class Twig
// Get Twig template layout
$template = $this->template($page->template() . $ext);
$output = $this->twig->render($template, $twig_vars);
try {
$output = $this->twig->render($template, $twig_vars);
} catch (\Twig_Error_Loader $e) {
throw new \RuntimeException('Resource not found.', 404, $e);
}
return $output;
}