Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private function render($no_output_filter = true, $display = null) {
call_user_func($callback, $this);
}

$renderException = null;
try {

Comment thread
ichaykin marked this conversation as resolved.
// read from cache or render
Expand All @@ -180,9 +181,21 @@ private function render($no_output_filter = true, $display = null) {
$this->getCompiled()->render($this);
}

} catch (\Throwable $e) {
$renderException = $e;
} finally {
Comment thread
ichaykin marked this conversation as resolved.
foreach ($this->endRenderCallbacks as $callback) {
call_user_func($callback, $this);
try {
foreach ($this->endRenderCallbacks as $callback) {
call_user_func($callback, $this);
}
} catch (\Throwable $callbackException) {
if ($renderException === null) {
throw $callbackException;
}
}

if ($renderException !== null) {
throw $renderException;
}
Comment thread
ichaykin marked this conversation as resolved.
Outdated
}

Expand Down
Loading