Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ErrorHandler] AddSapiErrorRendererSelector for context-based error rendering#60033

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
yceruto wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromyceruto:cli_errors

Conversation

yceruto
Copy link
Member

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

Alternative approach to#58456 (same goal), using a factory selector to pick the correct error renderer based on the context (PHP_SAPI). One advantage of this solution is that it works even ifTwigBundle is not installed as the selector/decider doesn't depend on it.

image

Spomky reacted with thumbs up emoji
@yceruto
Copy link
MemberAuthor

Now after updating some related tests, I'm concerned that this might break some functional tests out there (after upgrading to 7.3) for example: testing HTML error pages usingWebTestCase won't work anymore if these tests are checking for more than just the error message.

Should we consider this a BC break?

Copilot

This comment was marked as resolved.

@ycerutoycerutoforce-pushed thecli_errors branch 2 times, most recently fromb30fac0 toc281ec6CompareApril 1, 2025 19:18
@Spomky
Copy link
Contributor

Hi,

Thanks, it looks good to me at first glance.
I'll test it on my side to see how it behaves.

yceruto reacted with heart emoji

@Spomky
Copy link
Contributor

testing HTML error pages usingWebTestCase won't work anymore if these tests are checking for more than just the error message.

Is there a way to opt-in for this feature (e.g. a dedicated env var)?

@yceruto
Copy link
MemberAuthor

testing HTML error pages using WebTestCase won't work anymore if these tests are checking for more than just the error message.

Is there a way to opt-in for this feature (e.g. a dedicated env var)?

This small change restores the previous behavior. We could document this adjustment for situations where you specifically want to test the actual HTML error page:

-    ->alias('error_renderer.default', 'error_handler.error_renderer.default')+    ->alias('error_renderer.default', 'error_renderer.html')

Most functional/end-to-end tests have a dedicated config file. That could be better than using an env var, since you can enable or disable this behavior case by case.

@yceruto
Copy link
MemberAuthor

Or we could add a new framework option to opt-in for this behavior, include a deprecation notice to make it the default in 8.0, and update the recipe file to set it as the default for new projects. What do you think?

@Spomky
Copy link
Contributor

Sounds good 👍

@ycerutoyceruto added the ❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze" labelApr 9, 2025
@ycerutoyceruto removed the ❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze" labelMay 2, 2025
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

4 participants
@yceruto@Spomky@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp