-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Hi,
the DI extension exits the application on error, silencing default error handler as the console application formats the errors better. (
Console/src/DI/ConsoleExtension.php
Line 192 in 28bc206
| if (PHP_SAPI === ConsoleApplication::CLI_SAPI) { |
Line 148 in 28bc206
| $this->handleException($e, $output); |
BUT if creation of console presenter / application fails (for example, when I misconfigured some service that gets used in injectPrimary of Nette\Application\UI\Presenter), the Nette application simply quits, because the console application does not run at all and there is no output at all.
I guess the solution would be to setup the Nette application onError handler in the CliPresenter, directly before it calls $this->console->run, would that be OK? Am I missing the point of setting the onError so early?
I would gladly prepare the PR if this or other solution is approved.