diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 3da88679e09..04190eba502 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -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) { } } }