[TASK] Bring back the exception code in exception messages 60/58260/4
authorAnja Leichsenring <anja.leichsenring@typo3.com>
Wed, 12 Sep 2018 18:38:46 +0000 (20:38 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 12 Sep 2018 21:35:10 +0000 (23:35 +0200)
If an exception identifies itself with a code, display it
next to the Exception title.

Change-Id: Ib24b7ce4e0bef426dd4e0f4b7f25c4f5338e02c6
Resolves: #86238
Releases: master
Reviewed-on: https://review.typo3.org/58260
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Tested-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Error/DebugExceptionHandler.php

index b8aee89..10e4bbb 100644 (file)
@@ -148,6 +148,7 @@ HTML;
     protected function getSingleThrowableContent(\Throwable $throwable, int $index, int $total): string
     {
         $exceptionTitle = get_class($throwable);
+        $exceptionCode = $throwable->getCode() ? '#' . $throwable->getCode() . ' ' : '';
         $exceptionMessage = $this->escapeHtml($throwable->getMessage());
 
         // The trace does not contain the step where the exception is thrown.
@@ -166,7 +167,7 @@ HTML;
                 <div class="trace-head">
                     <h3 class="trace-class">
                         <span class="text-muted">({$index}/{$total})</span>
-                        <span class="exception-title">{$exceptionTitle}</span>
+                        <span class="exception-title">{$exceptionCode}{$exceptionTitle}</span>
                     </h3>
                     <p class="trace-message break-long-words">{$exceptionMessage}</p>
                 </div>