Properly handle exception within templates
* fixes partial printed templates when exception is thrown in between
This commit is contained in:
parent
54f6c05c79
commit
12f1adb7bb
|
@ -168,8 +168,13 @@ class Base {
|
||||||
|
|
||||||
// Include
|
// Include
|
||||||
ob_start();
|
ob_start();
|
||||||
include $file;
|
try {
|
||||||
$data = ob_get_contents();
|
include $file;
|
||||||
|
$data = ob_get_contents();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
@ob_end_clean();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
@ob_end_clean();
|
@ob_end_clean();
|
||||||
|
|
||||||
// Return data
|
// Return data
|
||||||
|
|
Loading…
Reference in New Issue