From 356ecc9e6add2a779e668841ac2764fce95b8156 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Wed, 7 Sep 2016 12:14:16 -0400 Subject: [PATCH] Consolidate error template setting --- src/Error/ExceptionRenderer.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Error/ExceptionRenderer.php b/src/Error/ExceptionRenderer.php index 6585fc1b735..db6e258f182 100644 --- a/src/Error/ExceptionRenderer.php +++ b/src/Error/ExceptionRenderer.php @@ -270,16 +270,7 @@ protected function _template(Exception $exception, $method, $code) $exception = $this->_unwrap($exception); $isHttpException = $exception instanceof HttpException; - if (!Configure::read('debug') && !$isHttpException) { - $template = 'error500'; - if ($code < 500) { - $template = 'error400'; - } - - return $this->template = $template; - } - - if ($isHttpException) { + if (!Configure::read('debug') && !$isHttpException || $isHttpException) { $template = 'error500'; if ($code < 500) { $template = 'error400';