Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[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
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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 using Should we consider this a BC break? |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
b30fac0
toc281ec6
CompareHi, Thanks, it looks good to me at first glance. |
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. |
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? |
Sounds good 👍 |
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.