Updating ExceptionRenderer and CakeErrorHandler for Controller changes.

This commit is contained in:
mark_story 2011-07-03 15:33:27 -04:00 committed by mark_story
parent 173e043eaf
commit 04147caca8
2 changed files with 6 additions and 4 deletions

View file

@ -22,8 +22,8 @@ class CakeErrorController extends AppController {
* @access public
* @return void
*/
public function __construct($request = null) {
parent::__construct($request);
public function __construct($request = null, $response = null) {
parent::__construct($request, $response);
$this->constructClasses();
$this->Components->trigger('initialize', array(&$this));
$this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));

View file

@ -22,6 +22,7 @@
App::uses('Sanitize', 'Utility');
App::uses('Router', 'Routing');
App::uses('CakeResponse', 'Network');
/**
* Exception Renderer.
@ -148,10 +149,11 @@ class ExceptionRenderer {
if (!$request = Router::getRequest(false)) {
$request = new CakeRequest();
}
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
try {
$controller = new CakeErrorController($request);
$controller = new CakeErrorController($request, $response);
} catch (Exception $e) {
$controller = new Controller($request);
$controller = new Controller($request, $response);
$controller->viewPath = 'Errors';
}
return $controller;