10000 bug #30976 [Debug] Fixed error handling when an error is already hand… · symfony/symfony@cd54e0f · GitHub
[go: up one dir, main page]

Skip to content

Commit cd54e0f

Browse files
committed
bug #30976 [Debug] Fixed error handling when an error is already handled when another error is already handled (5) (lyrixx)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug] Fixed error handling when an error is already handled when another error is already handled (5) | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | --- Please, don't ask how to reproduce it :) Commits ------- a36c731 [Debug] Fixed error handling when an error is already handled when another error is already handled (5)
2 parents cb5a255 + a36c731 commit cd54e0f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private function formatPath($path, $line)
372372
$fmt = $this->fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
373373

374374
if (!$fmt) {
375-
return sprintf('<span class="block trace-file-path">in <a title="%s%3$s"><strong>%s</strong>%s</a></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
375+
return sprintf('<span class="block trace-file-path">in <span title="%s%3$s"><strong>%s</strong>%s</span></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
376376
}
377377

378378
if (\is_string($fmt)) {
@@ -388,7 +388,11 @@ private function formatPath($path, $line)
388388

389389
$link = strtr($fmt[0], ['%f' => $path, '%l' => $line]);
390390
} else {
391-
$link = $fmt->format($path, $line);
391+
try {
392+
$link = $fmt->format($path, $line);
393+
} catch (\Exception $e) {
394+
return sprintf('<span class="block trace-file-path">in <span title="%s%3$s"><strong>%s</strong>%s</span></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
395+
}
392396
}
393397

394398
return sprintf('<span class="block trace-file-path">in <a href="%s" title="Go to source"><strong>%s</string>%s</a></span>', $this->escapeHtml($link), $file, 0 < $line ? ' line '.$line : '');

0 commit comments

Comments
 (0)
0