diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index b315a36cd..2ee473221 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -272,10 +272,11 @@ class ExceptionRenderer { $this->controller->afterFilter(); $this->controller->response->send(); } catch (MissingViewException $e) { - try { - $this->_outputMessage('error500'); - } catch (Exception $e) { + $attributes = $e->getAttributes(); + if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) { $this->_outputMessageSafe('error500'); + } else { + $this->_outputMessage('error500'); } } catch (Exception $e) { $this->_outputMessageSafe('error500');