Skip to content

TwigBundle error controller issue with Symfony 4.4 #34631

Closed
@XWB

Description

@XWB

Symfony version(s) affected: 4.4.0

Description
I'm upgrading to Symfony 4.4 and going through the following steps:

  • Deprecated twig.exception_controller configuration option, set it to "null" and use framework.error_controller instead.

First I set twig.exception_controller to null:

twig:
    exception_controller: null

Next I need to set framework.error_controller. The default value is twig.controller.exception::showAction as can be seen in https://github.com/symfony/twig-bundle/blob/4.4/DependencyInjection/Configuration.php#L41

framework:
    error_controller: 'twig.controller.exception::showAction'

This results in the following error:

Argument 2 passed to Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction() must be an instance of Symfony\Component\Debug\Exception\FlattenException, instance of TypeError given, called in vendor/symfony/http-kernel/HttpKernel.php on line 146

How to reproduce
See above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions