Fixing issue where a non CakeException would break things.

Test added.
This commit is contained in:
mark_story 2011-02-13 15:13:52 -05:00
parent 451b3fd18d
commit 844c6315c1
2 changed files with 17 additions and 1 deletions

View file

@ -100,6 +100,9 @@ class ExceptionRenderer {
if ($exception instanceof CakeException && !$methodExists) {
$method = '_cakeError';
if (empty($template)) {
$template = 'error500';
}
if ($template == 'internalError') {
$template = 'error500';
}

View file

@ -556,8 +556,21 @@ class ExceptionRendererTest extends CakeTestCase {
'/(\/|\\\)sidebox.php/'
),
500
),
array(
new Exception('boom'),
array(
'/Internal Error/'
),
500
),
array(
new RuntimeException('another boom'),
array(
'/Internal Error/'
),
500
)
);
}