Skip to content

[HttpKernel] Removing deprecated exception attribute (cleanup) #33983

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
Show file tree
Hide file tree
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

This file was deleted.

1 change: 0 additions & 1 deletion src/Symfony/Component/ErrorRenderer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
"autoload": {
"psr-4": { "Symfony\\Component\\ErrorRenderer\\": "" },
"classmap": [ "Resources/stubs/Exception/FlattenException.php" ],
"exclude-from-classmap": [
"/Tests/"
]
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CHANGELOG
* removed the second and third argument of `FileLocator::__construct`
* removed loading resources from `%kernel.root_dir%/Resources` and `%kernel.root_dir%` as
fallback directories.
* removed `exception` attribute passed to the configured controller of the `ExceptionListener`

4.4.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\EventListener;

use Psr\Log\LoggerInterface;
use Symfony\Component\Debug\Exception\FlattenException as LegacyFlattenException;
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down Expand Up @@ -115,21 +114,9 @@ protected function logException(\Exception $exception, string $message)
*/
protected function duplicateRequest(\Exception $exception, Request $request): Request
{
@trigger_error(sprintf('Passing the "exception" attribute (instance of "%s") to the configured controller of the "%s" class is deprecated since Symfony 4.4, use the passed "e" attribute (instance of "%s") instead.', LegacyFlattenException::class, self::class, FlattenException::class));

$flattenException = FlattenException::createFromThrowable($exception);

// BC layer to be removed in 5.0
if (class_exists(\Symfony\Component\Debug\Debug::class, false)) {
$legacyFlattenException = LegacyFlattenException::createFromThrowable($exception);
} else {
$legacyFlattenException = $flattenException;
}

$attributes = [
'_controller' => $this->controller,
'exception' => $legacyFlattenException, // to be removed in 5.0
'e' => $flattenException,
'e' => FlattenException::createFromThrowable($exception),
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
];
$request = $request->duplicate(null, null, $attributes);
Expand Down