Skip to content

Commit

Permalink
Fix missing view variables.
Browse files Browse the repository at this point in the history
When rendering a exception caught when rendering
an exception, some view variables were missing causing fatal
errors.

Fixes #2843
  • Loading branch information
markstory committed May 5, 2012
1 parent efe8364 commit 7416c53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -268,6 +268,11 @@ protected function _outputMessage($template) {
$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');
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Error/ExceptionRendererTest.php
Expand Up @@ -639,7 +639,7 @@ public function testMissingRenderSafe() {
->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));
Expand Down Expand Up @@ -671,7 +671,7 @@ public function testMissingSubdirRenderSafe() {
->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));
Expand Down

0 comments on commit 7416c53

Please sign in to comment.