-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.7] Fixed flatten exception recursion with errors #17052
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
Conversation
this is not good, as it looses the debugging info.It might be better to wrap it in a FatalThrowableError to be able to continue the flattening |
I'm fine with that if you want me to make that change. I just thought you'd want to separate that behaviour from that class, so I went with skipping. |
How does this look then? |
👍 |
I'll add a couple of tests in a few hours. |
Status: needs work |
Sorry, I'll get to this soon. ;) |
Ping @nicolas-grekas. Not sure what's going on with travis. Looks like it couldn't be arsed to run the tests for some reason? |
Yeh, PHP 5.4 and 5.5 are running no tests for some reason. :/ |
This travis issue is affecting the entire code base. For example, one of your PRs didn't get the tests run: #17104. |
5.4 and 5.5 are skipped for PRs so that we get more slots on travis |
Ah, right, so it was intentional. That makes sense. I was just worried that they were getting silently skipped. ;) |
They still waste about 50 seconds of time though each. :( |
Yep... I found no way to be quicker, the slow part is apt-get, which can't be skipped AFAIK |
Test passing now btw. ;) |
👍 |
Is this good to merge then? I'm just concious that new symfony releases normally happen around a month after the previous ones, and I'd quite like to have this fix included in the next set of releases. BTW, Happy Christmas everyone. 🎄 |
Thank you @GrahamCampbell. |
…mCampbell) This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #17052). Discussion ---------- [2.7] Fixed flatten exception recursion with errors | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Consider the following code: ```php $error = new ParseError(); $exception = new RuntimeException($error->getMessage(), $error->getCode(), $error); $flat = new Symfony\Component\Debug\Exception\FlattenException($exception); ``` Without this fix, that code is broken. You'll end up with something like this: ``` FatalThrowableError in FlattenException.php line 76: Type error: Argument 1 passed to Symfony\Component\Debug\Exception\FlattenException::create() must be an instance of Exception, instance of ParseError given ``` --- I came across this error issue in laravel/framework#11329. Commits ------- 2b0721d [2.7] Fixed flatten exception recursion with errors
:) |
* 2.3: Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"
…th errors (GrahamCampbell)"" This reverts commit e60889a.
* 2.7: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 Do not use HttpKernel Extension when not needed bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/Security/Acl/Dbal/AclProvider.php src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
* 2.8: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 Do not use HttpKernel Extension when not needed bumped Symfony version to 2.8.2 updated VERSION for 2.8.1 updated CHANGELOG for 2.8.1 bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: CHANGELOG-2.3.md CHANGELOG-2.7.md CHANGELOG-2.8.md src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php src/Symfony/Component/Console/Shell.php src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php src/Symfony/Component/HttpKernel/Kernel.php
* 3.0: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 bumped Symfony version to 3.0.2 Do not use HttpKernel Extension when not needed updated VERSION for 3.0.1 updated CHANGELOG for 3.0.1 bumped Symfony version to 2.8.2 updated VERSION for 2.8.1 updated CHANGELOG for 2.8.1 bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: src/Symfony/Component/HttpKernel/Kernel.php
* 2.7: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 Do not use HttpKernel Extension when not needed bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/Security/Acl/Dbal/AclProvider.php src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
* 2.8: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 Do not use HttpKernel Extension when not needed bumped Symfony version to 2.8.2 updated VERSION for 2.8.1 updated CHANGELOG for 2.8.1 bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: CHANGELOG-2.3.md CHANGELOG-2.7.md CHANGELOG-2.8.md src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php src/Symfony/Component/Console/Shell.php src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php src/Symfony/Component/HttpKernel/Kernel.php
* 3.0: [travis] timeout the sigchild tests at 60s CS: Single line comments should use double slashes (//) and not hash (#). Do not use HttpKernel Extension when not needed for 2.7 bumped Symfony version to 3.0.2 Do not use HttpKernel Extension when not needed updated VERSION for 3.0.1 updated CHANGELOG for 3.0.1 bumped Symfony version to 2.8.2 updated VERSION for 2.8.1 updated CHANGELOG for 2.8.1 bumped Symfony version to 2.7.9 updated VERSION for 2.7.8 updated CHANGELOG for 2.7.8 bumped Symfony version to 2.3.37 updated VERSION for 2.3.36 update CONTRIBUTORS for 2.3.36 updated CHANGELOG for 2.3.36 Revert "Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"" Revert "bug symfony#17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)" use nowdoc instead of heredoc Conflicts: src/Symfony/Component/HttpKernel/Kernel.php
Consider the following code:
Without this fix, that code is broken.
You'll end up with something like this:
I came across this error issue in laravel/framework#11329.