Skip to content

Commit

Permalink
Handle exception when RequestHandler::startup() fails.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markstory committed Dec 13, 2014
1 parent cf108db commit c58e7da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -153,9 +153,14 @@ 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;
}
if ($startup === false && !empty($controller) && $controller->Components->enabled('RequestHandler')) {
try {
$controller->RequestHandler->startup($controller);
} catch (Exception $e) {
}
}
}
Expand Down

0 comments on commit c58e7da

Please sign in to comment.