Skip to content

[ErrorHandler] Registering basic exception handler to handle early failures #33260

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
Aug 20, 2019

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Aug 20, 2019

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

This behavior was previously handled by the removed ExceptionHandler class in #32637.

As this method is mainly called during Kernel boot, where nothing is yet available, the Response content is always HTML. Otherwise, If all goes well on booting, this exception handler will be replaced in DebugHandlersListener class:

$handler->setExceptionHandler($this->exceptionHandler);

where the advanced exception handler mechanism is activated.

@yceruto yceruto added this to the next milestone Aug 20, 2019
@yceruto yceruto force-pushed the error_handler_early_failure branch 3 times, most recently from 4a0deb6 to 6a6e730 Compare August 20, 2019 18:56
@yceruto yceruto force-pushed the error_handler_early_failure branch from 6a6e730 to a2077a2 Compare August 20, 2019 18:59
@fabpot
Copy link
Member

fabpot commented Aug 20, 2019

Thank you @yceruto.

fabpot added a commit that referenced this pull request Aug 20, 2019
…le early failures (yceruto)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Registering basic exception handler to handle early failures

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

This behavior was previously handled by the removed `ExceptionHandler` class in #32637.

As this method is mainly called during Kernel boot, where nothing is yet available, the Response content is always HTML. Otherwise, If all goes well on booting, this exception handler will be replaced in `DebugHandlersListener` class:
https://github.com/symfony/symfony/blob/8073b8abfb82d59c6acabce7cec7bfb3af24738a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php#L139

where the advanced exception handler mechanism is activated.

Commits
-------

a2077a2 Registers basic exception handler to handle early failures
@fabpot fabpot merged commit a2077a2 into symfony:4.4 Aug 20, 2019
@yceruto yceruto deleted the error_handler_early_failure branch August 20, 2019 19:10
fabpot added a commit that referenced this pull request Sep 3, 2019
… late failures (yceruto)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Registering basic exception handler for late failures

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

Follow-up #33260 but when all handlers fail.

It'll becomes common since 4.4 where the user has control over the error rendering mechanism. If they make a mistake, we have a support page to show it, currently a blank page is displayed.

Commits
-------

ffab734 registering basic exception handler for late failures
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
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.

4 participants