Skip to content
Merged
Changes from all commits
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
12 changes: 9 additions & 3 deletions libraries/src/Exception/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ public static function render($error)
// Push the error object into the document
$document->setError($error);

// Clear buffered output at all levels in non-test mode
$callerFunction = static::getCallerFunctionName();
// Clear buffered output at all levels
while (ob_get_level())
{
ob_end_clean();
}

// This is needed to ensure the test suite can still get the output buffer
ob_start();

$document->setTitle(Text::_('ERROR') . ': ' . $error->getCode());

Expand Down Expand Up @@ -176,7 +182,7 @@ public static function render($error)
protected static function getCallerFunctionName()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zero-24 I think this function can be removed now - it's not longer being called

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be used as its part of the API right? It can be removed with 4 i guess right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a protected function and introduced in 3.10 - its only been in alpha's so far?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok will do a PR to get rid of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR done: #32175

{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);

return isset($backtrace[2]['function']) ? $backtrace[2]['function'] : false;
}

Expand Down