Skip to content

Commit 7e8f517

Browse files
Merge branch '6.4' into 7.1
* 6.4: [Process] minor fix [Process] Fix finding executables independently of open_basedir [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it parse empty sequence elements as null
2 parents 2305134 + 0a93aed commit 7e8f517

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

EventListener/DebugHandlersListener.php

+14
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function configure(?object $event = null): void
6767
return;
6868
}
6969
$this->firstCall = $this->hasTerminatedWithException = false;
70+
$hasRun = null;
7071

7172
if (!$this->exceptionHandler) {
7273
if ($event instanceof KernelEvent) {
@@ -103,6 +104,19 @@ public function configure(?object $event = null): void
103104

104105
if ($handler instanceof ErrorHandler) {
105106
$handler->setExceptionHandler($this->exceptionHandler);
107+
if (null !== $hasRun) {
108+
$throwAt = $handler->throwAt(0) | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR | \E_USER_ERROR | \E_RECOVERABLE_ERROR | \E_PARSE;
109+
$loggers = [];
110+
111+
foreach ($handler->setLoggers([]) as $type => $log) {
112+
if ($type & $throwAt) {
113+
$loggers[$type] = [null, $log[1]];
114+
}
115+
}
116+
117+
// Assume $kernel->terminateWithException() will log uncaught exceptions appropriately
118+
$handler->setLoggers($loggers);
119+
}
106120
}
107121
$this->exceptionHandler = null;
108122
}

0 commit comments

Comments
 (0)