Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06ab7ec

Browse files
committed
[FrameworkBundle] ease migration to symfony 6.3
1 parent c31276b commit 06ab7ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ public function boot()
9898
$_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger';
9999

100100
$handler = ErrorHandler::register(null, false);
101-
$this->container->get('debug.error_handler_configurator')->configure($handler);
101+
102+
// When upgrading an existing Symfony application from 6.2 to 6.3, and
103+
// the cache is warmed up, the service is not available yet, so we need
104+
// to check if it exists.
105+
if ($this->container->has('debug.error_handler_configurator')) {
106+
$this->container->get('debug.error_handler_configurator')->configure($handler);
107+
}
102108

103109
if ($this->container->getParameter('kernel.http_method_override')) {
104110
Request::enableHttpMethodParameterOverride();

0 commit comments

Comments
 (0)