Skip to content

Commit 323c604

Browse files
Merge branch '5.4' into 6.4
* 5.4: Tweak error/exception handler registration
2 parents c1ac8df + 75479d2 commit 323c604

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

EventListener/DebugHandlersListener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function __construct(?callable $exceptionHandler = null, bool|LoggerInter
4747
// BC with Symfony 5
4848
$webMode = null;
4949
}
50-
$handler = set_exception_handler('is_int');
50+
51+
$handler = set_exception_handler('var_dump');
5152
$this->earlyHandler = \is_array($handler) ? $handler[0] : null;
5253
restore_exception_handler();
5354

@@ -94,7 +95,7 @@ public function configure(?object $event = null): void
9495
}
9596
}
9697
if ($this->exceptionHandler) {
97-
$handler = set_exception_handler(static fn () => null);
98+
$handler = set_exception_handler('var_dump');
9899
$handler = \is_array($handler) ? $handler[0] : null;
99100
restore_exception_handler();
100101

EventListener/ErrorListener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ public function onKernelException(ExceptionEvent $event)
104104

105105
$throwable = $event->getThrowable();
106106

107-
if ($exceptionHandler = set_exception_handler(var_dump(...))) {
108-
restore_exception_handler();
109-
if (\is_array($exceptionHandler) && $exceptionHandler[0] instanceof ErrorHandler) {
110-
$throwable = $exceptionHandler[0]->enhanceError($event->getThrowable());
111-
}
107+
$exceptionHandler = set_exception_handler('var_dump');
108+
restore_exception_handler();
109+
110+
if (\is_array($exceptionHandler) && $exceptionHandler[0] instanceof ErrorHandler) {
111+
$throwable = $exceptionHandler[0]->enhanceError($event->getThrowable());
112112
}
113113

114114
$request = $this->duplicateRequest($throwable, $event->getRequest());

0 commit comments

Comments
 (0)