Skip to content

[Debug][ErrorCatcher][BC Break] Restoring removed public methods from ExceptionHandler and deprecating them #32374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
48 changes: 48 additions & 0 deletions src/Symfony/Component/ErrorCatcher/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,52 @@ public function sendPhpResponse($exception)

echo $this->errorRenderer->render($exception);
}

/**
* Gets the full HTML content associated with the given exception.
*
* @param \Throwable|FlattenException $exception An \Exception or FlattenException instance
*
* @return string The HTML content as a string
*
* @deprecated since Symfony 4.4, use the HtmlErrorRenderer::render() method of the ErrorCatcher component instead.
*/
public function getHtml($exception)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use the HtmlErrorRenderer::render() method of the ErrorCatcher component instead.', __METHOD__), E_USER_DEPRECATED);

if ($exception instanceof \Throwable) {
$exception = FlattenException::createFromThrowable($exception);
}

return $this->errorRenderer->render($exception);
}

/**
* Gets the HTML content associated with the given exception.
*
* @return string The content as a string
*
* @deprecated since Symfony 4.4, use the HtmlErrorRenderer::getBody() method of the ErrorCatcher component instead.
*/
public function getContent(FlattenException $exception)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use the HtmlErrorRenderer::getBody() method of the ErrorCatcher component instead.', __METHOD__), E_USER_DEPRECATED);

return $this->errorRenderer->getBody($exception);
}

/**
* Gets the stylesheet associated with the given exception.
*
* @return string The stylesheet as a string
*
* @deprecated since Symfony 4.4, use the HtmlErrorRenderer::getStylesheet() method of the ErrorCatcher component instead.
*/
public function getStylesheet(FlattenException $exception)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use the HtmlErrorRenderer::getStylesheet() method of the ErrorCatcher component instead.', __METHOD__), E_USER_DEPRECATED);

return $this->errorRenderer->getStylesheet();
}
}