Skip to content

[FrameworkBundle][BC Break] Adding http_exception_listener introduces BC break to exception handling #27212

Closed
@Majkl578

Description

@Majkl578

Symfony version(s) affected: 4.0.9/4.1.0-BETA1

Description
Commit 4e527aa added a service http_exception_listener. This registers a system-wide exception handler that sets request's _controller attribute to a closure during kernel.exception.
Also this closure controller generates a response on the event. As a consequence of that, this triggers listeners on kernel.response event - with _controller as a closure instead of previously not being invoked at all, and the generated response instead of null.

How to reproduce
Failing test case provided separately in #27213.

Additional context
Encountered in API-only application, no templating etc., only custom request/response handling and custom exception handling.

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