Feature #106153
openMake it easy to copy exception stacktrace
0%
Description
The default debug exception handler not only shows the exception type, message and stacktrace, but also the code at the stack locations.
This makes it hard to copy the stacktrace into a issue or ticket, because the code snippets need to be removed manually.
It would be nice if the exception page HTML would contain the clean stack trace as HTML comment, so that we can copy it from there.
Other exception handlers¶
The default laravel exception handler facade/ignition does so: Each exception page begins with a HTML comment very early in the response:
<!doctype html> <html class="theme-light"> <!-- Exception: in file app/Http/Controllers/GraphQLController.php on line 37 #0 vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\GraphQLController->processUrl() #1 vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction() [...] #58 {main} --> <head>
Files
Updated by Gerrit Code Review about 1 month ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88201
Updated by Garvin Hicking about 1 month ago
- File Screenshot 2025-02-12 at 18.46.48.png Screenshot 2025-02-12 at 18.46.48.png added
- File Screenshot 2025-02-12 at 18.46.56.png Screenshot 2025-02-12 at 18.46.56.png added
This is a nice idea. I made a little different implementation that offers a javascript functionality to toggle between the views. What do you think?
Screenshots:
Updated by Garvin Hicking 26 days ago
- Related to Task #106218: Make copy/paste from the backtrace page to the IDE more comfortable added
Updated by Gerrit Code Review 16 days ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88201
Updated by Garvin Hicking 16 days ago
Updated by Christian Weiske 16 days ago
I think all that functionality is overkill. I only need something to obtain the stack trace in a way I can paste into bug reports.
Copying single lines, the HTML version, the minimal HTML version does not help.
Even the plain text version is too verbose to be pasted into bug reports.
Updated by Garvin Hicking 16 days ago
ยท Edited
I spent the whole saturday on this, maybe we can try to productively improve this.
Its not copy a single line, but to copy the filename&line number!
Copying the HTML could help for ticket systems that have some basic formatting, or HTML mails to colleagues, or archiving.
And for TYPO3 bug reports here you would actually copy everything. We need all the verbose information. You would copy the full HTML and attach a HTML file here.
What's not good about the plain text copy, how would you expect the output to be? Create an example with a few stack items please.
And you can ignore all the copy buttons if you use your mouse to cooy/extract the portions you want...?
Updated by Christian Weiske 13 days ago
I already included an example stack trace in the issue description.
Here is another example plain text stack trace from symfony which is pretty dense and does not contain too many newlines:
Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Twig_Extensions_Extension_Debug" from the global namespace. Did you forget a "use" statement? at app/cache/dev/ContainerS5mwhr5/appDevDebugProjectContainer.php:876 at ContainerS5mwhr5\appDevDebugProjectContainer->getTwigService() (app/cache/dev/ContainerS5mwhr5/getAssetic_AssetManagerService.php:8) at require('/var/www/timetracker/app/cache/dev/ContainerS5mwhr5/getAssetic_AssetManagerService.php') (app/cache/dev/ContainerS5mwhr5/appDevDebugProjectContainer.php:732) at ContainerS5mwhr5\appDevDebugProjectContainer->load() (app/cache/dev/ContainerS5mwhr5/getRouting_LoaderService.php:19)