Fix missing view variables.

When rendering a exception caught when rendering
an exception, some view variables were missing causing fatal
errors.

Fixes #2843
This commit is contained in:
mark_story 2012-05-05 13:25:36 -04:00
parent efe836480b
commit 7416c530a2
2 changed files with 7 additions and 2 deletions

View file

@ -268,6 +268,11 @@ class ExceptionRenderer {
$this->controller->afterFilter();
$this->controller->response->send();
} catch (Exception $e) {
$this->controller->set(array(
'error' => $e,
'name' => $e->getMessage(),
'code' => $e->getCode(),
));
$this->_outputMessageSafe('error500');
}
}

View file

@ -639,7 +639,7 @@ class ExceptionRendererTest extends CakeTestCase {
->with('missingHelper')
->will($this->throwException($exception));
$ExceptionRenderer->controller->expects($this->at(4))
$ExceptionRenderer->controller->expects($this->at(5))
->method('render')
->with('error500')
->will($this->returnValue(true));
@ -671,7 +671,7 @@ class ExceptionRendererTest extends CakeTestCase {
->with('error400')
->will($this->throwException($exception));
$ExceptionRenderer->controller->expects($this->at(3))
$ExceptionRenderer->controller->expects($this->at(4))
->method('render')
->with('error500')
->will($this->returnValue(true));