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

[HttpKernel] fix handling of nested Error instances #27662

Merged
merged 1 commit into from
Jun 21, 2018

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 20, 2018

Q A
Branch? 4.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27613
License MIT
Doc PR

@xabbuh
Copy link
Member Author

xabbuh commented Jun 20, 2018

This can happen when the exception controller is registered as a private service and was removed (now that we catch every Error instance): https://github.com/symfony/symfony/blob/4.1/src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php#L48-L73

@xabbuh xabbuh changed the base branch from 4.0 to 4.1 June 20, 2018 19:58
@xabbuh xabbuh added this to the 4.1 milestone Jun 20, 2018
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "if" should be replaced by a ternary operator to select Exception or Error, to allow changing the previous of errors, isn't it?

@xabbuh
Copy link
Member Author

xabbuh commented Jun 21, 2018

Yes, I was under the false impression that the Error class doesn't have this property. Fixed now.

@xabbuh
Copy link
Member Author

xabbuh commented Jun 21, 2018

We could also merge this into 4.0 to account for the not so likely case that an ArgumentCountError is thrown during resolving the exception controller.

@nicolas-grekas
Copy link
Member

Even 3.4 actually, but the check needs to be for Exception then, not Error, to account for polyfills.

@xabbuh xabbuh changed the base branch from 4.1 to 3.4 June 21, 2018 10:39
@xabbuh xabbuh modified the milestones: 4.1, 3.4 Jun 21, 2018
@xabbuh
Copy link
Member Author

xabbuh commented Jun 21, 2018

indeed, done

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit a6696d0 into symfony:3.4 Jun 21, 2018
nicolas-grekas added a commit that referenced this pull request Jun 21, 2018
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix handling of nested Error instances

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27613
| License       | MIT
| Doc PR        |

Commits
-------

a6696d0 fix handling of nested Error instances
@xabbuh xabbuh deleted the issue-27613 branch June 21, 2018 14:05
This was referenced Jun 25, 2018
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.

3 participants