Merge pull request #5406 from cakephp/issue-5311

Handle exception when RequestHandler::startup() fails.

Refs #5311
This commit is contained in:
Mark Story 2014-12-14 18:05:35 -05:00
commit af8febf635

View file

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