Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpKernel] Decouple exception logging from rendering #25366

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

Merged
merged 1 commit into from
Dec 14, 2017
Merged

[HttpKernel] Decouple exception logging from rendering #25366

merged 1 commit into from
Dec 14, 2017

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Dec 6, 2017

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25266
License MIT
Doc PR symfony/symfony-docs#...

Given your controller throws an exception and a custom exception listener sets a response.

Before
image

After
image

;-)

edit: raising the priority for the profiler listener fixes the exception panel also.

@fabpot
Copy link
Member

fabpot commented Dec 14, 2017

Thank you @ro0NL.

@fabpot fabpot merged commit a203d31 into symfony:master Dec 14, 2017
fabpot added a commit that referenced this pull request Dec 14, 2017
… (ro0NL)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[HttpKernel] Decouple exception logging from rendering

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25266
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Given your controller throws an exception and a custom exception listener sets a response.

Before
![image](https://user-images.githubusercontent.com/1047696/33676886-46e90e0a-dab7-11e7-9a3a-24c70b23d4e0.png)

After
![image](https://user-images.githubusercontent.com/1047696/33676832-1ac4f0aa-dab7-11e7-9ac4-483fcbdc06ee.png)

;-)

edit: raising the priority for the profiler listener fixes the exception panel also.

Commits
-------

a203d31 [HttpKernel] Decouple exception logging from rendering
@ro0NL ro0NL deleted the logexceptions branch December 14, 2017 08:24
@sroze
Copy link
Contributor

sroze commented Dec 14, 2017

Nice @ro0NL 👍

4.1.0
-----

* `ExceptionListener` now logs and collects exceptions at priority `2048` (previously logged at `-128` and collected at `0`)
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth to add this to the upgrade file too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What exactly needs an upgrade step?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about other listeners that relied on this one being executed before/after themselves. Probably an edge case though that's not needed to be tackled.

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.

7 participants