Skip to content

BC-break ExceptionListener and FlattenException #32473

@Devristo

Description

@Devristo

Symfony version(s) affected: 4.4 branch

Description

Some third-party libraries / bundles depend on \Symfony\Component\HttpKernel\EventListener\ExceptionListener and \Symfony\Component\Debug\Exception\FlattenException. In Symfony 4.4 a \Symfony\Component\ErrorCatcher\Exception\FlattenException is thrown instead.

An example of a third-party project is Api-platform. See https://github.com/api-platform/core/blob/8b9203436c162e82ce42515f8e6eacd7077e705b/src/Action/ExceptionAction.php#L62 for the dependency on Debug\Exception\FlattenException.

Probably the way Api-Platform uses the ExceptionListener is not so common amongst other projects. Should I open an issue there instead?

How to reproduce

Try exception handling on api-platform on Symfony 4.4

Possible Solution

  • Make the FlattenException in ErrorCatcher-component inherit the one in Debug ? Only possible if there is a dependency between the two components.

Somewhat related issues:

#32371

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions