Bug #100871
Updated by Torben Hansen over 1 year ago
With #99912, @setCatchExceptions(false)@ has been implemented to @TYPO3\CMS\Core\Console\CommandApplication@, so that exceptions from symfony console are handled by TYPO3 exception handlers. That change made This is good, since it is now possible to log CLI errors in TYPO3 logs, errors, but after thinking more about one major downside of the change, I see some downsides in #99912 as pointed out below: * change is, that CLI now throws all symfony console exceptions, which does Symfony Console exceptions in a not look really pretty * Possible user errors (e.g. unknown command or invalid amount of arguments) are now logged to the TYPO3 log Example: @./typo3/sysext/core/bin/typo3 site:show@ way. <pre> Uncaught TYPO3 Exception Not enough arguments (missing: "identifier"). thrown in file /path/to/typo3/vendor/symfony/console/Input/Input.php in line 70 </pre> Also note, that #100059 fixes the described problem about the not registered listener in #99912. So it is now possible I suggest to register event listeners, who actually catch all CLI errors. I'm currently not really sure, what is best to resolve the described downsides. We could either catch common/known symfony console common Symfony Console exceptions in our exceptions handlers and print output the error message in a "pretty" way or we could revert #99912 and implement an event listener for @ConsoleErrorEvent@ events, which logs those errors to the TYPO3 log. CLI friendly way.