bug #25753 [Console] Fix restoring exception handler (nicolas-grekas, fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Console] Fix restoring exception handler | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | ,p | Tests pass? | yes | Fixed tickets | #25718 | License | MIT | Doc PR | - Commits -------0096449
[Console] Keep the modified exception handler3fa1ad9
[Console] Fix restoring exception handler
This commit is contained in:
commit
d8d85f17b5
@ -163,10 +163,18 @@ class Application
|
||||
$exitCode = 1;
|
||||
}
|
||||
} finally {
|
||||
// if the exception handler changed, keep it
|
||||
// otherwise, unregister $renderException
|
||||
if (!$phpHandler) {
|
||||
if (set_exception_handler($renderException) === $renderException) {
|
||||
restore_exception_handler();
|
||||
}
|
||||
restore_exception_handler();
|
||||
} elseif (!$debugHandler) {
|
||||
$phpHandler[0]->setExceptionHandler(null);
|
||||
$finalHandler = $phpHandler[0]->setExceptionHandler(null);
|
||||
if ($finalHandler !== $renderException) {
|
||||
$phpHandler[0]->setExceptionHandler($finalHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user