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';