mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing issue where a non CakeException would break things.
Test added.
This commit is contained in:
parent
451b3fd18d
commit
844c6315c1
2 changed files with 17 additions and 1 deletions
|
@ -100,6 +100,9 @@ class ExceptionRenderer {
|
|||
|
||||
if ($exception instanceof CakeException && !$methodExists) {
|
||||
$method = '_cakeError';
|
||||
if (empty($template)) {
|
||||
$template = 'error500';
|
||||
}
|
||||
if ($template == 'internalError') {
|
||||
$template = 'error500';
|
||||
}
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue