summaryrefslogtreecommitdiffstats
path: root/src/Monolog/ErrorHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/ErrorHandler.php')
-rw-r--r--src/Monolog/ErrorHandler.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php
index e4f0e83..d0b1aa6 100644
--- a/src/Monolog/ErrorHandler.php
+++ b/src/Monolog/ErrorHandler.php
@@ -77,7 +77,12 @@ class ErrorHandler
public function registerExceptionHandler($levelMap = [], $callPrevious = true): self
{
$prev = set_exception_handler([$this, 'handleException']);
- $this->uncaughtExceptionLevelMap = array_replace($this->defaultExceptionLevelMap(), $levelMap);
+ $this->uncaughtExceptionLevelMap = $levelMap;
+ foreach ($this->defaultExceptionLevelMap() as $class => $level) {
+ if (!isset($this->uncaughtExceptionLevelMap[$class])) {
+ $this->uncaughtExceptionLevelMap[$class] = $level;
+ }
+ }
if ($callPrevious && $prev) {
$this->previousExceptionHandler = $prev;
}