mirror of
https://github.com/getgrav/grav.git
synced 2026-02-22 22:51:13 +01:00
Better error message when template file isn't found
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user