diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index c1835fd6eb0..53f50021770 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -66,8 +66,6 @@ public function __construct($request = null, $response = null) { if ($this->Components->enabled('Security')) { $this->Components->disable('Security'); } - $this->startupProcess(); - $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors')); } diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 3be08d26cd6..b315a36cd8d 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -150,7 +150,11 @@ protected function _getController($exception) { $response = new CakeResponse(array('charset' => Configure::read('App.encoding'))); try { $controller = new CakeErrorController($request, $response); + $controller->startupProcess(); } catch (Exception $e) { + if (!empty($controller) && $controller->Components->enabled('RequestHandler')) { + $controller->RequestHandler->startup($controller); + } } if (empty($controller)) { $controller = new Controller($request, $response);