mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #5406 from cakephp/issue-5311
Handle exception when RequestHandler::startup() fails. Refs #5311
This commit is contained in:
commit
af8febf635
1 changed files with 12 additions and 1 deletions
|
@ -153,9 +153,20 @@ class ExceptionRenderer {
|
|||
try {
|
||||
$controller = new CakeErrorController($request, $response);
|
||||
$controller->startupProcess();
|
||||
$startup = true;
|
||||
} catch (Exception $e) {
|
||||
if (!empty($controller) && $controller->Components->enabled('RequestHandler')) {
|
||||
$startup = false;
|
||||
}
|
||||
// Retry RequestHandler, as another aspect of startupProcess()
|
||||
// could have failed. Ignore any exceptions out of startup, as
|
||||
// there could be userland input data parsers.
|
||||
if ($startup === false &&
|
||||
!empty($controller) &&
|
||||
$controller->Components->enabled('RequestHandler')
|
||||
) {
|
||||
try {
|
||||
$controller->RequestHandler->startup($controller);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue