Skip to content

[Console][DX] Error handling degradation in 3.3 #22259

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

Closed
chalasr opened this issue Apr 3, 2017 · 1 comment
Closed

[Console][DX] Error handling degradation in 3.3 #22259

chalasr opened this issue Apr 3, 2017 · 1 comment

Comments

@chalasr
Copy link
Member

chalasr commented Apr 3, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.3

#18140 introduced a ConsoleErrorEvent to replace the exception event, catching both errors and exceptions in Application.

Problem

We lost all the benefit of using the Debug component along with the Console one (using the fullstack framework included): the DebugHandlersListener is no more reached, making the following code useless https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php#L107-L116
Also, any custom error handler in userland will no more be called.

Example using the fullstack

public function execute(InputInterface $input, OutputInterface $output) 
{
    $this->foo();
}

public function fooo() 
{
}

Before 3.3

before

After

after

Possible solutions

Dunno yet. We definitely need a way to give errors to the error handler if any.

/cc @ogizanagi who reported the issue in #20808 (comment) which hasn't received any answer at the moment.

@chalasr
Copy link
Member Author

chalasr commented Apr 4, 2017

Fixed in #22261

fabpot added a commit that referenced this issue Apr 4, 2017
… by console.error listeners (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Give errors back to error handler if not handled by console.error listeners

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22259
| License       | MIT
| Doc PR        | n/a

Re-throws errors if `ConsoleErrorEvent::markErrorAsHandled()` hasn't been called so that they can reach the global error handler, fixing the BC break.

Commits
-------

5a5bf54 [Console] Give errors back to error handlers if not handled by console.error listeners
@fabpot fabpot closed this as completed Apr 4, 2017
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

2 participants