Skip to content

[HttpKernel] Enhance exception if possible #50911

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
Jul 30, 2023
Merged

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jul 7, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? restore an old feature
Deprecations? no
Tickets
License MIT
Doc PR

I don't know if it's the best place to do that.
I think in the kernel, it would be better, WDYT?

Before

image

After :

image

@lyrixx
Copy link
Member Author

lyrixx commented Jul 8, 2023

I really wonder if the controller is the best place to do that

  • If one use a custom controller, it won't work
  • I should also add support for the console components, right?

@lyrixx
Copy link
Member Author

lyrixx commented Jul 9, 2023

I updated the PR

  • Introduced ErrorHandler::enchanceError()
  • Move the call from the ErrorController to the ErrorListener (this is more global like this)

@lyrixx
Copy link
Member Author

lyrixx commented Jul 10, 2023

There were 15 errors:

1) Symfony\Component\HttpKernel\Tests\EventListener\ErrorListenerTest::testHandleWithoutLogger with data set #0 (Symfony\Component\HttpKernel\Event\ExceptionEvent Object (...), Symfony\Component\HttpKernel\Event\ExceptionEvent Object (...))
Error: Call to undefined method Symfony\Component\ErrorHandler\ErrorHandler::enhanceError()

tests are KO because the new code does not exist yet in 7.0?

@yceruto
Copy link
Member

yceruto commented Jul 11, 2023

tests are KO because the new code does not exist yet in 7.0?

I think after synchronizing with 7.0 it should be fixed

@fabpot
Copy link
Member

fabpot commented Jul 30, 2023

Thank you @lyrixx.

@fabpot fabpot merged commit 48b0d9d into symfony:6.4 Jul 30, 2023
@lyrixx lyrixx deleted the error-enhancer branch July 30, 2023 17:31
PhilETaylor pushed a commit to PhilETaylor/symfony that referenced this pull request Sep 6, 2023
…ixx)

This PR was merged into the 6.4 branch.

Discussion
----------

[HttpKernel] Enhance exception if possible

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | restore an old feature
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I don't know if it's the best place to do that.
I think in the kernel, it would be better, WDYT?

Before

![image](https://github.com/symfony/symfony/assets/408368/e2a452aa-b669-4598-8b23-5366c5b80a74)

After :

![image](https://github.com/symfony/symfony/assets/408368/0e30c50d-5c94-43db-a9e5-19be6ccd5f2b)

Commits
-------

2bfb9d9 [HttpKernel] Enhance exception if possible
This was referenced Oct 21, 2023
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.

8 participants