closes #4842, clean up logic in ErrorHandler

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7228 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-06-21 15:35:17 +00:00
parent 42db64bbb3
commit 605bfa5bc5

View file

@ -98,20 +98,17 @@ class ErrorHandler extends Object {
$method = 'error';
}
if ($method == 'error') {
$this->dispatchMethod($method, $messages);
$this->_stop();
} elseif (Configure::read() == 0 && (isset($code) && $code == 500)) {
$this->dispatchMethod('error500', $messages);
exit();
} elseif (Configure::read() == 0) {
$this->dispatchMethod('error404', $messages);
$this->_stop();
} else {
$this->dispatchMethod($method, $messages);
$this->_stop();
if ($method !== 'error') {
if (Configure::read() == 0){
$method = 'error404';
if(isset($code) && $code == 500) {
$method = 'error500';
}
}
}
$this->dispatchMethod($method, $messages);
$this->_stop();
}
/**
* Displays an error page (e.g. 404 Not found).
*