Project

General

Profile

Actions

Bug #99912

closed

ProductionExceptionHandler does not handle CLI Exceptions

Added by Christoph Lehmann almost 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2023-02-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #100059: Events dispatched by Symfony EventDispatcher are not dispatched to TYPO3 listeners any moreClosed2023-03-01

Actions
Related to TYPO3 Core - Bug #99493: On CLI no exceptions are loggedClosedHelmut Hummel2023-01-08

Actions
Related to TYPO3 Core - Bug #100871: Common symfony command exceptions should not be thrownClosedTorben Hansen2023-05-13

Actions
Actions

Also available in: Atom PDF