Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Debug] Fixed error handling when an error is already handled when another error is already handled (5) #30976

Merged
merged 1 commit into from Apr 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Symfony/Component/Debug/ExceptionHandler.php
Expand Up @@ -372,7 +372,7 @@ private function formatPath($path, $line)
$fmt = $this->fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');

if (!$fmt) {
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 : '');
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 : '');
}

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

$link = strtr($fmt[0], ['%f' => $path, '%l' => $line]);
} else {
$link = $fmt->format($path, $line);
try {
$link = $fmt->format($path, $line);
} catch (\Exception $e) {
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 : '');
lyrixx marked this conversation as resolved.
Show resolved Hide resolved
}
}

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 : '');
Expand Down