Skip to content

Events profiler and logs get confused when an exception is thrown in one of listeners  #24275

@Xymanek

Description

@Xymanek
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.8

Events panel

No exception behaviour:
screenshot_1

Exception in marked listener:
screenshot_2

Note that in case of exception the previous listeners successfully run and then all kernel.controller listeners were called again (without any exceptions). Sub-request profiler shows exactly the same events and logs view.

Logs panel

The thrown exception was NotFoundHttpException and this is the log view (very long): https://user-images.githubusercontent.com/2865341/30692725-73b966be-9ed5-11e7-8e7d-9a17de034981.png

Notice how it says

Notified event "kernel.controller" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke"

Order of events is weird too:

request -> controller -> response -> finish_request -> exception -> response -> finish_request

While in reality (using xDebug):

request -> security.authentication.success -> controller -> exception -> request -> controller -> controller_arguments -> response -> finish_request -> response -> finish_request -> terminate

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