8000 Also log previous exceptions in ExceptionListener? · Issue #7973 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Also log previous exceptions in ExceptionListener? #7973
Closed
@mpdude

Description

@mpdude

Sometimes I have the need (in controllers) to convert some internal application exceptions to more meaningful (HTTP-appropriate) ones.

For example, some object that cannot be found in a database and triggers an exception should become a NotFoundHttpException, or I want to keep the internal exception of my authentication subsystem but throw an AccessDeniedHttpException.

The "previous" exception property of \Exception is well suited for that and in kernel.debug I'll get all that information (I guess, from what I recall the exception pages...)

In production, however, the user gets the error page and all the relevant information must go to the logs.

So do you agree it would be a good thing to make the ExceptionListener also log the previous exceptions?

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

      0