Closed
Description
Symfony version(s) affected: 4.1.0
Description
After upgrade to Symfony 4.1.0, this error Class "twig.controller.exception" does not exist.
is displayed when an exception is not catched by the user code.
How to reproduce
<?php
namespace App\Controller;
class FailController
{
public function __invoke()
{
throw new \Exception("Error Processing Request", 1);
}
}
Possible Solution
When I add this configuration, the exception handler work fine:
# config/packages/twig.yaml
twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
# I have add this line:
exception_controller: Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction
And this service configuration
# config/services.yaml
services:
Symfony\Bundle\TwigBundle\Controller\ExceptionController:
alias: twig.controller.exception
public: true
Additional context