mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Handle exception when RequestHandler::startup() fails.
In the case that there is a request data type parser raises an exception, or startup() otherwise fails the error page should be created correctly. While I'm not able to write a test case for this, manual testing confirmed the fix. Refs #5311
This commit is contained in:
parent
cf108dbff3
commit
c58e7da667
1 changed files with 6 additions and 1 deletions
|
@ -153,9 +153,14 @@ class ExceptionRenderer {
|
|||
try {
|
||||
$controller = new CakeErrorController($request, $response);
|
||||
$controller->startupProcess();
|
||||
$startup = true;
|
||||
} catch (Exception $e) {
|
||||
if (!empty($controller) && $controller->Components->enabled('RequestHandler')) {
|
||||
$startup = false;
|
||||
}
|
||||
if ($startup === false && !empty($controller) && $controller->Components->enabled('RequestHandler')) {
|
||||
try {
|
||||
$controller->RequestHandler->startup($controller);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue