[Debug] Always decorate existing exception handlers to deal with fatal errors
This commit is contained in:
parent
3a8f905e10
commit
205d7ae3f7
@ -147,11 +147,14 @@ class ErrorHandler
|
|||||||
$handler = $prev[0];
|
$handler = $prev[0];
|
||||||
$replace = false;
|
$replace = false;
|
||||||
}
|
}
|
||||||
if ($replace || !$prev) {
|
if (!$replace && $prev) {
|
||||||
$handler->setExceptionHandler(set_exception_handler(array($handler, 'handleException')));
|
|
||||||
} else {
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
|
if (is_array($prev = set_exception_handler(array($handler, 'handleException'))) && $prev[0] === $handler) {
|
||||||
|
restore_exception_handler();
|
||||||
|
} else {
|
||||||
|
$handler->setExceptionHandler($prev);
|
||||||
|
}
|
||||||
|
|
||||||
$handler->throwAt($levels & $handler->thrownErrors, true);
|
$handler->throwAt($levels & $handler->thrownErrors, true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user