#106153Make it easy to copy exception stacktrace
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>Reviews 1
Related issues 2
Files 11
- Screenshot 2025-02-12 at 18.46.48.png
- Screenshot 2025-02-12 at 18.46.56.png
- typo3_exception.png
- Screenshot 2026-02-03 at 22.21.19.png
- Screenshot 2026-02-03 at 22.20.59.png
- Screenshot 2026-02-03 at 22.21.37.png
- Screenshot 2026-02-03 at 22.21.53.png
- Screenshot 2026-02-03 at 22.22.30.png
- Screenshot 2026-02-03 at 22.22.42.png
- Screenshot 2026-02-03 at 22.22.51.png
- Screenshot 2026-02-03 at 22.23.10.png
History 1122
-
Gerrit Code Review pushed patch set 1 for main to change 88201 status
NewUnder Review <span data-processor="relativetime" data-value="2025-02-12T17:46:42+00:00" > 02/12/25, 17:46 </span> -
Garvin Hicking commented and changed attached Screenshot 2025-02-12 at 18.46.48.png attached Screenshot 2025-02-12 at 18.46.56.png <span data-processor="relativetime" data-value="2025-02-12T17:47:54+00:00" > 02/12/25, 17:47 </span>
-
Garvin Hicking changed Related to #106218 <span data-processor="relativetime" data-value="2025-02-20T09:25:13+00:00" > 02/20/25, 09:25 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 88201 <span data-processor="relativetime" data-value="2025-03-01T21:51:01+00:00" > 03/01/25, 21:51 </span>
-
Christian Weiske commented <span data-processor="relativetime" data-value="2025-03-02T07:51:01+00:00" > 03/02/25, 07:51 </span>
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. -
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-03-02T09:20:36+00:00" > 03/02/25, 09:20 </span>
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…?
-
Christian Weiske commented <span data-processor="relativetime" data-value="2025-03-05T09:04:01+00:00" > 03/05/25, 09:04 </span>
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) -
Gerrit Code Review pushed patch set 3 for main to change 88201 <span data-processor="relativetime" data-value="2025-09-27T19:08:33+00:00" > 09/27/25, 19:08 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 88201 <span data-processor="relativetime" data-value="2025-09-29T16:09:42+00:00" > 09/29/25, 16:09 </span>
-
Garvin Hicking changed Related to #108320 <span data-processor="relativetime" data-value="2025-11-26T10:09:25+00:00" > 11/26/25, 10:09 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 88201 <span data-processor="relativetime" data-value="2025-11-26T10:14:05+00:00" > 11/26/25, 10:14 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 88201 <span data-processor="relativetime" data-value="2026-01-30T15:15:01+00:00" > 01/30/26, 15:15 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 88201 <span data-processor="relativetime" data-value="2026-02-01T09:39:47+00:00" > 02/01/26, 09:39 </span>
-
Sybille Peters commented and changed attached typo3_exception.png <span data-processor="relativetime" data-value="2026-02-01T10:13:55+00:00" > 02/01/26, 10:13 </span>
My 2c on issue:
- I did not know what stack trace you mean, I assume you mean stacktrace in Frontend (or also in BE)?
- Adding “how to reproduce” might be awesome, e.g.
1. Settings => Configuration Presets => Debug settings => “Debug”
2. In TypoScript : config.contentObjectExceptionHandler = 0
3. Cause exception, e.g. by invoking page with invalid type e.g. http://t3coredev14/styleguide/?type=333——
Personally, I usually take the exception trace from the file log, then I have to convert \\n to \n, replace my sitename, shorten it and can upload it as file.
For having helpful issues, I think it would definitely help to have stack traces in some cases.
But, you could upload the entire dump as file. Usually, the first 2 or 3 items might suffice to copy them as “pre” in issue.
If people are not testing with the latest version, having the source-code lines might actually be helpful. (though it would be better if they did, but they might be using latest release, not git-based).
-
Gerrit Code Review pushed patch set 8 for main to change 88201 <span data-processor="relativetime" data-value="2026-02-01T11:15:11+00:00" > 02/01/26, 11:15 </span>
-
Garvin Hicking commented and changed attached Screenshot 2026-02-03 at 22.20.59.png attached Screenshot 2026-02-03 at 22.21.19.png attached Screenshot 2026-02-03 at 22.21.37.png attached Screenshot 2026-02-03 at 22.21.53.png attached Screenshot 2026-02-03 at 22.22.30.png attached Screenshot 2026-02-03 at 22.22.42.png attached Screenshot 2026-02-03 at 22.22.51.png attached Screenshot 2026-02-03 at 22.23.10.png <span data-processor="relativetime" data-value="2026-02-03T21:27:15+00:00" > 02/03/26, 21:27 </span>
Here are some more screenshots. Also a comparison of https://github.com/dkd-dobberkau/enhanced-error-handler is included.
-
Gerrit Code Review pushed patch set 9 for main to change 88201 <span data-processor="relativetime" data-value="2026-02-03T21:32:46+00:00" > 02/03/26, 21:32 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 88201 <span data-processor="relativetime" data-value="2026-02-11T08:46:31+00:00" > 02/11/26, 08:46 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 88201 <span data-processor="relativetime" data-value="2026-02-11T09:53:40+00:00" > 02/11/26, 09:53 </span>
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-02-11T13:10:08+00:00" > 02/11/26, 13:10 </span>Applied in changeset commit:359cda320081b94187083a239a48c21495197aa3.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T09:00:42+00:00" > 03/31/26, 09:00 </span>
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: