88201[FEATURE] Improve DebugExceptionHandler with clipboard functionality
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Georg Ringer +1
- Matthias Vogel +1
-
Verified V +2 Done
- Garvin Hicking +2
- Georg Ringer +1
- Matthias Vogel +1
- core-ci +1 CI
Issues 1
Files 4
- Build/Sources/TypeScript/core/utility/debug-exception-handler-service.ts5new+188 −0
- typo3/sysext/core/Classes/Error/DebugExceptionHandler.php10+91 −3
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-106153-ImproveDebugExceptionHandlerWithCopyFunctionality.rstnew+56 −0
- typo3/sysext/core/Resources/Public/JavaScript/utility/debug-exception-handler-service.jsnew+37 −0
Review log 3950
Show 1825 earlier messages
-
Garvin Hicking uploaded patch set 1 02/12/25, 17:46
-
core-ci voted on patch set 1 V +1 02/12/25, 17:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74062
-
Georg Ringer commented on patch set 1 02/12/25, 19:17
-
Garvin Hicking commented on patch set 1 02/12/25, 20:22
DebugExceptionHandler.php:141ReplyThen it would need styling and probably an icon, and a wrapping form.... I thought it to be a bit bloaty. But let's see if anyone actualy likes this, happy to try ti change it then. -
Oliver Wand voted on patch set 1 CR +1 02/20/25, 08:38
-
Andreas Kienast commented on patch set 1 CR -1 02/20/25, 10:40
DebugExceptionHandler.php:427If it's not a button, let's not name it as suchDebugExceptionHandler.php:427constDebugExceptionHandler.php:441Why do we need to return something here? -
Andreas Kienast commented on patch set 1 02/20/25, 10:45
Another issue: you introduce inline JS again which we hardly removed in previous releases.DebugExceptionHandler.php:141ReplyYou neither need an icon, nor a wrapping form element. IIRC this was true for XHTML back then. -
Garvin Hicking commented on patch set 1 02/20/25, 12:47
Reply
I figured because CSS was delivered inline, it was a conscious decission to let the stacktrace not have dependencies to other HTTP requests, even if it's static CSS/JS. Before I address the other (very valid) concerns, we should decide whether this is an option. I think the functionality is nice and it already could have a follow-up feature: https://forge.typo3.org/issues/106218 Then we could have a JS function that copies a file with line number into the clipboard. If you see no issues with creating and referencing a static JS file that is build via TS, I would prefer going that route. Another option would be to inline the statically built JS file with some "file_get_contents" type...? -
Garvin Hicking uploaded patch set 2
CR +1V +103/01/25, 21:50 -
Garvin Hicking commented on patch set 2 03/01/25, 21:56
Reply
I refactored this to a built TS->JS file, which is inlined (because URI resolving in the Exception handler would be bad).Please have another look, I rebuild this. Video: https://www.dropbox.com/scl/fi/kr90gwa35qembi0ecktvy/t3-exception-to-clipboard.m4v?rlkey=9m28qigm00resot4nfilqrkmj&e=1&dl=0DebugExceptionHandler.php:141ReplyRefactored this (a lot).DebugExceptionHandler.php:427ReplyDoneDebugExceptionHandler.php:427ReplyDoneDebugExceptionHandler.php:441ReplyDone -
core-ci voted on patch set 2 V +1 03/01/25, 21:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74946
-
Garvin Hicking rebased onto patch set 3
V +109/27/25, 19:08 -
core-ci voted on patch set 3 V -1 09/27/25, 19:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85647
-
Garvin Hicking rebased onto patch set 4
V -109/29/25, 16:09 -
core-ci voted on patch set 4 V -1 09/29/25, 16:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85701
-
Garvin Hicking uploaded patch set 5
V -111/26/25, 10:14 -
core-ci voted on patch set 5 V +1 11/26/25, 10:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91010
-
Sven Liebert commented on patch set 5 11/26/25, 10:56
When copying the plaintext stack trace I have some unnecessary whitespaces in front of some lines. And IMO we should style the buttons a bit more than using default browser button (sorry they are very ugly :D) Thank you for this nice one. -
Garvin Hicking commented on patch set 5 11/26/25, 11:02
Reply
Yeah. This is honestly more a "proof of concept" and would need both JS and CSS love. Which my body and mind is unable to give :-D -
Simon Schaufelberger commented on patch set 5 11/27/25, 01:04
No more video -
Garvin Hicking commented on patch set 5 11/27/25, 06:02
Reply
Yesh it's deleted, one has to check out the patch now 🙃 -
Garvin Hicking rebased onto patch set 6
V +101/30/26, 15:14 -
core-ci voted on patch set 6 V +1 01/30/26, 15:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94684
-
Sybille Peters updated the commit message in patch set 7
V +102/01/26, 09:39 -
core-ci voted on patch set 7 V +1 02/01/26, 09:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94755
-
Sybille Peters commented on patch set 7 V -1 02/01/26, 10:03
When I caused in exception in FE, I see little icons to copy /page, e.g. next to in /var/www/t3coredev14/typo3/sysext/frontend/Classes/Controller/ErrorController.php However, copy-paste does not work. Also, I get an exception in browser console: Uncaught TypeError: Cannot read properties of undefined (reading 'writeText') at HTMLButtonElement.<anonymous> (styleguide/?type=333:252:305) I tested this way: 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 -
Garvin Hicking commented on patch set 7 02/01/26, 10:34
Reply
Some browsers (firefox iirc) do not allow to access the clipboard on non-https uris which you seem to use. I'll add a gating to that to inform about it, and a fallback to only show the next in that case. Thanks! -
Benni Mack commented on patch set 7 02/01/26, 11:05
-
Garvin Hicking updated the commit message in patch set 8
V +102/01/26, 11:15 -
core-ci voted on patch set 8 V +1 02/01/26, 11:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94758
-
Garvin Hicking commented on patch set 8 02/01/26, 11:50
Reply
@benni@typo3.org I think we need this in the core. It's a feature for us supporters triagers. We often get bad or no stacktraces. I would not want to tell people to install an extension, it needs to work out of the box. But I could talk to dkd how they feel about migrating parts of it to the core then, do you agree? -
Garvin Hicking commented on patch set 8 02/01/26, 12:44
Reply
I got in touch with Olivier. He supports to join forces and combine the advantages his patch has into this one (giving credit of course). I'll work on that to propose an improved version of this patch, which should also improve the visuals. I firmly believe we need this to reduce friction in supporting TYPO3's stability and quality with better feedback. -
Garvin Hicking uploaded patch set 9
V +102/03/26, 21:32 -
Garvin Hicking commented on patch set 9 02/03/26, 21:35
Reply
Optimized the plaintext now, and also aligned the button styling a bit more to TYPO3 current CSS. Also I've contacted @andy@pixelde.su and kindly asked for his help on improving the JS/CSS. :)Reply
A fallback is now available.Reply
I now slimmed the buttons a bit down, did some more minor styling, added a fallback when the clipboard copying fails, added some brief instructions, shortened the bottom section instructions, optimized the plaintext export and icons, and added a feature ReST file. -
core-ci voted on patch set 9 V +1 02/03/26, 21:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94946
-
Matthias Vogel commented on patch set 9 02/10/26, 12:44
I think it would be better to put it at the top where everyone can easily see it.debug-exception-handler-service.ts:79Can we only copy the relative path from the project folder? Most developers use DDEV or Docker with directory mounting/mapping. The absolute path that PHP uses and the absolute path that the IDE uses can differ. -
Garvin Hicking commented on patch set 9 02/10/26, 14:49
Reply
I think it would push down the iformation too much. I want to see the first 1/2 stacktrace boxes before other info. To me even the docs link is too disturbing. That's why I added a quickjump to the bottom... ?debug-exception-handler-service.ts:79ReplyHm that would mean it needs access to some data that we can not access because of possible errors. The debug handler needs to have zero dependencies to other Environment:: classes or so. I think the user has to do that replacement, or how would you proceed? If there's a way I'm open for it. -
Matthias Vogel uploaded patch set 10
V +102/11/26, 08:46 -
Matthias Vogel commented on patch set 10 02/11/26, 08:46
Reply
Donedebug-exception-handler-service.ts:79ReplyDone -
Matthias Vogel voted on patch set 10 CR +1 V +1 02/11/26, 08:46
-
core-ci voted on patch set 10 V +1 02/11/26, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95605
-
Garvin Hicking commented on patch set 10 02/11/26, 09:37
Reply
DoneHang on, we're on it and neeed to adjust for a case for exception without codes. -
Matthias Vogel uploaded patch set 11
CR +1V +102/11/26, 09:53 -
core-ci voted on patch set 11 V +1 02/11/26, 10:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95607
-
Matthias Vogel voted on patch set 11 CR +1 V +1 02/11/26, 10:04
-
Georg Ringer voted on patch set 11 CR +1 V +1 02/11/26, 12:45
-
Garvin Hicking commented on patch set 11 CR +2 V +2 02/11/26, 13:08
Reply
DoneThanks Mathias and everyone else who helped to improve this, I think the solution is much better now. If anyone has issues with this, I would say we can iterate on it. This one's been on the stove for a long time now and it seems I can't motivate more people to chew on it :-D -
Garvin Hicking merged patch set 12 02/11/26, 13:08
-
Josua Vogel commented on patch set 12 02/11/26, 13:15
debug-exception-handler-service.ts:82Don´t forget to remove this ;) -
Garvin Hicking commented on patch set 12 02/11/26, 13:19
debug-exception-handler-service.ts:82Reply UnresolvedGah, thanks. Guess that's one reason for a followup now. :-D
DebugExceptionHandler.php:141