Skip to content

[ErrorHandler] Forward \Throwable #33038

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
Sep 27, 2019

Conversation

fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Aug 8, 2019

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

The goal of this PR is that ErrorHandler::handleException() handles \Throwable directly and forwards it without altering it.

@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch from f9c9b5c to c172572 Compare August 8, 2019 08:35
@nicolas-grekas nicolas-grekas added this to the next milestone Aug 8, 2019
@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch from c172572 to 5cc95fa Compare August 8, 2019 10:51
@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch 2 times, most recently from c8db006 to 735f9ab Compare August 8, 2019 13:16
@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch from 735f9ab to 1feadf0 Compare August 12, 2019 08:54
@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch 2 times, most recently from 37424a5 to 07ba636 Compare September 10, 2019 11:46
@fancyweb fancyweb force-pushed the error-handler-handle-throwable branch from 07ba636 to 62483ed Compare September 10, 2019 12:10
@fabpot
Copy link
Member

fabpot commented Sep 27, 2019

Thank you @fancyweb.

fabpot added a commit that referenced this pull request Sep 27, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Forward \Throwable

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

The goal of this PR is that `ErrorHandler::handleException()` handles `\Throwable` directly and forwards it  without altering it.

Commits
-------

62483ed [ErrorHandler] Forward \Throwable
@fabpot fabpot merged commit 62483ed into symfony:4.4 Sep 27, 2019
@fancyweb fancyweb deleted the error-handler-handle-throwable branch September 27, 2019 06:37
Tobion added a commit that referenced this pull request Oct 11, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

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

Built on top of #33038 so review only the second commit : d5c3f7e

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf [ErrorHandler] Rework fatal error handlers
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Oct 11, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

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

Built on top of symfony/symfony#33038 so review only the second commit : symfony/symfony@d5c3f7e

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf523 [ErrorHandler] Rework fatal error handlers
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull request Oct 11, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

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

Built on top of symfony/symfony#33038 so review only the second commit : symfony/symfony@d5c3f7e

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf [ErrorHandler] Rework fatal error handlers
symfony-splitter pushed a commit to symfony/console that referenced this pull request Oct 11, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

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

Built on top of symfony/symfony#33038 so review only the second commit : symfony/symfony@d5c3f7e

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf523 [ErrorHandler] Rework fatal error handlers
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
nicolas-grekas added a commit that referenced this pull request Nov 5, 2019
… down (fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

Deprecate things that prevent \Throwable from bubbling down

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes (todo update CHANGELOGS & UPGRADES)
| Tests pass?   | yes
| Fixed tickets | #32605
| License       | MIT
| Doc PR        | -

~The goal of this PR is to allow `\Throwable` forwarded from the`ErrorHandler::handleException()` method (cf #33038) to bubble down in our code base without having to convert them into exceptions.~

~WIP because I'm blocked by 2 things caused by `GetResponseForExceptionEvent::getThrowable()` returning a `\Throwable` instead of an `\Exception`.~

~1. This `\Throwable` end up in `DataCollectorInterface::collect()` (cf `ProfilerListener`). So that looks impossible to support in 4.4. What can we do?~
~2. The second blocker is `ExceptionListener::duplicateRequest()`. We are not gonna rename this method to support `\Throwable` I guess. What can we do?~

Since there are blockers to do it in 4.4, let's prepare for the future and deprecate the things that block us.

Commits
-------

abef506 Deprecate things that prevent \Throwable from bubbling down
This was referenced Nov 12, 2019
PhilETaylor pushed a commit to PhilETaylor/symfony that referenced this pull request Sep 6, 2023
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Forward \Throwable

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

The goal of this PR is that `ErrorHandler::handleException()` handles `\Throwable` directly and forwards it  without altering it.

Commits
-------

62483ed [ErrorHandler] Forward \Throwable
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