mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 17:42:41 +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 {
|
try {
|
||||||
$controller = new CakeErrorController($request, $response);
|
$controller = new CakeErrorController($request, $response);
|
||||||
$controller->startupProcess();
|
$controller->startupProcess();
|
||||||
|
$startup = true;
|
||||||
} catch (Exception $e) {
|
} 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);
|
$controller->RequestHandler->startup($controller);
|
||||||
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue