Catch errors in template rendering. Output a generic error and log problem.
This commit is contained in:
parent
677ad71b96
commit
8ad24ca3e8
@ -37,7 +37,13 @@ function replace_macros($s, $r) {
|
|||||||
call_hooks('replace_macros', $arr);
|
call_hooks('replace_macros', $arr);
|
||||||
|
|
||||||
$t = App::template_engine();
|
$t = App::template_engine();
|
||||||
|
|
||||||
|
try {
|
||||||
$output = $t->replace_macros($arr['template'], $arr['params']);
|
$output = $t->replace_macros($arr['template'], $arr['params']);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
logger("Unable to render template: ",$e->getMessage());
|
||||||
|
$output = "<h3>ERROR: there was an error creating the output.</h3>";
|
||||||
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user