diff --git a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php index 36e5cd4028010..339b28e83c695 100644 --- a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php @@ -98,7 +98,13 @@ public function boot() $_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger'; $handler = ErrorHandler::register(null, false); - $this->container->get('debug.error_handler_configurator')->configure($handler); + + // When upgrading an existing Symfony application from 6.2 to 6.3, and + // the cache is warmed up, the service is not available yet, so we need + // to check if it exists. + if ($this->container->has('debug.error_handler_configurator')) { + $this->container->get('debug.error_handler_configurator')->configure($handler); + } if ($this->container->getParameter('kernel.http_method_override')) { Request::enableHttpMethodParameterOverride();