Skip to content

Commit

Permalink
bug #33632 [ErrorRenderer] fix Cannot use object of type ErrorExcepti…
Browse files Browse the repository at this point in the history
…on 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
  • Loading branch information
fabpot committed Sep 19, 2019
2 parents 5b5b7de + 063dc78 commit b5ff996
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -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 } ?>>
Expand Down

0 comments on commit b5ff996

Please sign in to comment.