Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] Render all throwables the same, including \Error subclasses #45885

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
wants to merge 1 commit into from

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Mar 30, 2022

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

I'm not sure why only \Exception was caught here. These should also be included and rendered nicely IMO:

Error
  ArithmeticError
    DivisionByZeroError
  AssertionError
  CompileError
    ParseError
  TypeError
    ArgumentCountError
  UnhandledMatchError
  ValueError

I believe it's an omission and hence worth a bugfix, but maybe I missed something.

@Seldaek
Copy link
Member Author

Seldaek commented Mar 30, 2022

There is a test failure - related to #22690 - maybe @chalasr can help here. It seems rethrowing was needed in the Symfony context so the symfony/debug handlers can do their job, but when using symfony/console inside Composer for example all I end up with is an unstyled error output from the native PHP uncaught exception handler.

I worked around this in composer/composer@af3e67e for the time being, as I wanted to render those type errors nicer, and also note I forced the stack trace to be shown for \Error (and its children) & \LogicException (not its children tho as things like InvalidArgumentException I wouldn't necessarily consider programming errors). Because getting error reports for things like type errors which are definitely program errors without stack trace is a real pain.

So feel free to close here if you think it's unreasonable, but I find the current state a slightly strange behavior for non-symfony-framework users of symfony/console.

@chalasr
Copy link
Member

chalasr commented Mar 30, 2022

Oh h*ck not this topic again 😅

@chalasr chalasr closed this Mar 30, 2022
@chalasr chalasr reopened this Mar 30, 2022
@Seldaek
Copy link
Member Author

Seldaek commented Mar 30, 2022

Yes I saw there's some history there :) That's why I said it's fine for me to close as well, I could achieve what I needed to achieve on my end, so no big deal.

@chalasr
Copy link
Member

chalasr commented Mar 30, 2022

Sorry I didn't mean to close! Let me check this.

@nicolas-grekas
Copy link
Member

Closing as explained, too risky for 4.4 at least.

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

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.