Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors during console presenter/application startup get silenced #81

Open
redwormik opened this issue Apr 30, 2019 · 0 comments
Open

Errors during console presenter/application startup get silenced #81

redwormik opened this issue Apr 30, 2019 · 0 comments

Comments

@redwormik
Copy link

redwormik commented Apr 30, 2019

Hi,

the DI extension exits the application on error, silencing default error handler as the console application formats the errors better. (

if (PHP_SAPI === ConsoleApplication::CLI_SAPI) {
,
$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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant