Issue Bug Closed

#99912ProductionExceptionHandler does not handle CLI Exceptions

Christoph Lehmann 02/09/23, 22:36 updated 07/09/24, 12:46

Description

When i call a command like ./typo3/sysext/core/bin/typo3 delete:records and it fires an Exception, then i would expect that is handled with \TYPO3\CMS\Core\Error\ProductionExceptionHandler.

Currently it is catched, because \Symfony\Component\Console\Application::$catchExceptions is true and handled by the Symfonys ConsoleErrorEvent.

The Event is dispatched by SymfonyEventDispatcher (not TYPO3 EventDispatcher), but it is not configured (has no listener), so nothing happens when you listen on the event.

Possible solution:

Set \Symfony\Component\Console\Application::setCatchExceptions(false)

Reviews 3