From c58e7da6676e190cc19aa0ddd1f673eaee94e86e Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 13 Dec 2014 15:04:11 -0500 Subject: [PATCH] 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 --- lib/Cake/Error/ExceptionRenderer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 3da88679e09..0a849020876 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -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) { } } }