[ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631

This commit is contained in:
k0d3r1s 2019-09-18 20:16:39 +03:00 committed by Fabien Potencier
parent 1efae63e64
commit 063dc78b49

View File

@ -16,7 +16,10 @@
} elseif ($log['priority'] >= 300) {
$status = 'warning';
} else {
$severity = $log['context']['exception']['severity'] ?? false;
$severity = 0;
if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException) {
$severity = $exception->getSeverity();
}
$status = E_DEPRECATED === $severity || E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
} ?>
<tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>>