Active
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2019 at 15:06 UTC
Updated:
4 Oct 2022 at 08:58 UTC
Jump to comment: Most recent
This would give us a nice looking error page with more readable stack trace. See attached screenshots.
The symfony/debug component is already included in Drupal code base as it is a dependency of symfony/http-kernel and symfony/console components.
| Comment | File | Size | Author |
|---|---|---|---|
| after.png | 104.42 KB | chi | |
| before.png | 72.19 KB | chi |
Comments
Comment #2
chi commentedI suppose this will require revising the entire error management system which by the way hasn't got much attention since Drupal 6.
https://git.drupalcode.org/project/drupal/blob/8.8.x/core/includes/error...
Comment #3
cilefen commentedThe before and after screenshots contain the same information. If this involves revisiting the entire error management system and adds a dependency, is this really worth doing?
Even better: https://github.com/filp/whoops
Comment #4
chi commented@cilefen those screenshots are only about exceptions. PHP errors (warnings, notices) are shown as messages in Drupal which makes the difference.
Comment #5
chi commentedHere is a simple way to enable Symfony Debug handlers on Drupal 8 site.
composer require --dev symfony/debugDebug::enable();Comment #7
chi commentedThe debug component has been removed in favor of the new ErrorHandler component.
https://symfony.com/doc/4.4/components/error_handler.html
That works for me.
Comment #8
chi commentedComment #9
andypostComment #10
volegerI think we also need to introduce an error handler template to be able to keep the existing error logging settings behavior.
Comment #12
prudloff commentedWe created a contrib module that does that: https://www.drupal.org/project/symfony_debug
Comment #14
volegerDebug component is deprecated since Symfony 4.4. Instead, use the ErrorHandler component.
Comment #17
kevinquillen commented+1 this is a fantastic idea.
I was getting Ignition integrated earlier after seeing that package thinking it would be a great DX enhancement. I love how you can add solution links with your custom exceptions - really useful for guiding users to getting help or answers on what they encountered instead of a dead end stop.
I think Drupal would really benefit from revamping its error handler along these lines. It would go a long way to helping less technical users/devs find answers or links to docs from an error screen (perhaps also baking in links to Drupal slack, etc).
Comment #18
steinmb commented+1
I guess we are aiming for minimum Symfony 5 here, if so, we need to target 10.x with this change.
Comment #20
quietone commentedI have closed #1722694: Fixed Kernel::init() overrides Drupal's error handling configuration which was re-opened to "Replace Drupal's error handling with Symfony/HttpKernel's". At the time sun commented on what to do next. Noting it here in case it is useful.
Also, adding the related issue from that issue.
Comment #21
aaronmchaleRemoving the circular reference ;)
Comment #22
bradjones1We would want to ideally use the debug flag set on the kernel, see #1537198: Add a Production/Development toggle