8000 bug #33632 [ErrorRenderer] fix Cannot use object of type ErrorExcepti… · symfony/symfony@b5ff996 · GitHub
[go: up one dir, main page]

Skip to content

Commit b5ff996

Browse files
committed
bug #33632 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 (k0d3r1s)
This PR was squashed before being merged into the 4.4 branch (closes #33632). Discussion ---------- [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #33631 | License | MIT This fixes exception thrown when trying to render ErrorException as an array Commits ------- 063dc78 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
2 parents 5b5b7de + 063dc78 commit b5ff996

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Component/ErrorRenderer/Resources/views/logs.html.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
} elseif ($log['priority'] >= 300) {
1717
$status = 'warning';
1818
} else {
19-
$severity = $log['context']['exception']['severity'] ?? false;
19+
$severity = 0;
20+
if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException) {
21+
$severity = $exception->getSeverity();
22+
}
2023
$status = E_DEPRECATED === $severity || E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
2124
} ?>
2225
<tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>>

0 commit comments

Comments
 (0)
0