Skip to content

[HttpKernel] Support for Throwable #22128

@lstrojny

Description

@lstrojny
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version master

The exception handling subsystem in Symfony’s HttpKernel does not support PHP 7 Throwables yet.

Changes

  • Let Symfony\Component\HttpKernel\HttpKernel::handle() catch Throwable
  • Invoke Symfony\Component\HttpKernel\HttpKernel::handleException() and pass Throwable
  • Change Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent to allow Throwable or Exception
    • This is a BC break  ⚠️
  • Change Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent to hint Exception|Throwable
    • This is a BC break ⚠️
  • Change Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException() to catch Throwable as well
  • Change Symfony\Component\HttpKernel\EventListener\ExceptionListener::logException() to accept Exception or Throwable
    • This is a BC break ⚠️
  • Change Symfony\Component\HttpKernel\EventListener\ExceptionListener::duplicateRequest() to accept Exception or Throwable
    • This is a BC break ⚠️
  • Change Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer::render() to handle Throwable

Anybody thinks that a bad idea? Anything I forgot? Feedback is more than welcome!

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