Skip to content

[HttpKernel] Error handling #45301

@enumag

Description

@enumag

In our app I noticed that some errors that happened in our API weren't correctly handled to return some error json. After some digging I found that HttpKernel only catches \Exception but not \Throwable:

I'm wondering whether this is intentional for some reason or if it is just a remnant of the past and should have been changed when Throwable was introduced. As you can see a few lines below you're calling $this->handleThrowable($e, $request, $type); but it's only called for Exception and not other Throwable.

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