-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ErrorHandler] Rework fatal errors #33053
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
0a610ae
to
fa9c9cb
Compare
src/Symfony/Component/ErrorHandler/Error/ClassNotFoundFatalError.php
Outdated
Show resolved
Hide resolved
fa9c9cb
to
5eb1bc5
Compare
(rebase needed) |
Impossible to resolve conflicts, because of 1st commit. |
5eb1bc5
to
b44845f
Compare
d8cc931
to
b3c53c4
Compare
@fancyweb Thanks a lot for this PR, great job so far! There are still some pending failures, let me know when this is ready for you and I will take a deeper look. |
468e40a
to
62f60ef
Compare
} | ||
} | ||
|
||
if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SymfonyClassLoader
is a dead component in 4.x. Do we still need to account for it in the new ErrorHandler component ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked about this with @nicolas-grekas a while ago, and he told me we can eventually stop supporting it on 5.0. But I didn't do it yet.
764e6ac
to
d5c3f7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9d4bf35
to
56295e0
Compare
src/Symfony/Component/ErrorHandler/Tests/phpt/decorate_exception_handler_lt_74.phpt
Outdated
Show resolved
Hide resolved
@fabpot Rebase is done and CI is green. |
src/Symfony/Component/ErrorHandler/ErrorEnhancer/ErrorEnhancerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/ErrorHandler/Error/ClassNotFoundError.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/ErrorHandler/Error/FatalErrorInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/ErrorHandler/FatalErrorHandler/FatalErrorHandlerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/ErrorHandler/FatalErrorHandler/FatalErrorHandlerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/ErrorHandler/ErrorEnhancer/ErrorEnhancerInterface.php
Outdated
Show resolved
Hide resolved
0dd5e9f
to
a4c93a6
Compare
Just repushed to take comments into account:
|
a4c93a6
to
aaa0cdf
Compare
Thanks @fancyweb for working on this feature, this is much appreciated. |
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
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler; | ||
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler; | ||
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer; | ||
use Symfony\Component\ErrorRenderer\Exception\FlattenException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintentionally deleted, fixed in #34075
This PR was merged into the 4.4 branch. Discussion ---------- [ErrorHandler] Import missing classes | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Fix #33053 (comment) Commits ------- e07a3d7 Import missing classes
…error enhancer (fancyweb) This PR was merged into the 5.0-dev branch. Discussion ---------- [ErrorHandler] Remove Symfony ClassLoader support in an error enhancer | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #33053 (comment) | License | MIT | Doc PR | - Throwing a deprecation for this on 4.4 looks useless to me as the component was deprecated 2 years ago and stopping its support will not break anything. Commits ------- e745654 [ErrorHandler] Remove Symfony ClassLoader support in an error enhancer
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.