Skip to content

Commit

Permalink
Merge pull request #5406 from cakephp/issue-5311
Browse files Browse the repository at this point in the history
Handle exception when RequestHandler::startup() fails.

Refs #5311
  • Loading branch information
markstory committed Dec 14, 2014
2 parents cf108db + ae8a540 commit af8febf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -153,9 +153,20 @@ protected function _getController($exception) {
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) {
}
}
}
Expand Down

0 comments on commit af8febf

Please sign in to comment.