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:
mark_story 2014-12-13 15:04:11 -05:00
parent cf108dbff3
commit c58e7da667

View file

@ -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) {
}
}
}