Use new logError in FrontController, tests

This commit is contained in:
Anton Terekhov
2012-12-11 15:42:17 +04:00
parent 91b364d01a
commit 5f47dab73e
3 changed files with 16 additions and 23 deletions

View File

@ -63,29 +63,7 @@ class ErrorAction extends Action
protected function logError()
{
if ($this->template == 500) {
$error = 0;
$ex = $this->exception;
if ($ex instanceof ErrorException) {
$error = $ex->getSeverity();
}
switch ($error) {
case E_NOTICE:
$error = 'Notice';
break;
case E_WARNING:
$error = 'Warning';
break;
case E_ERROR:
$error = 'Fatal Error';
break;
default:
$error = 'Unknown Error';
break;
}
$message = 'PHP ' . $error . ': ' . $ex->getMessage() . ' in ' . $ex->getFile()
. ' on line ' . $ex->getLine();
error_log($message);
ErrorHandler::logError($this->exception);
}
}

View File

@ -143,6 +143,7 @@ class FrontController
header('HTTP/1.0 500 Internal Server Error');
}
}
ErrorHandler::logError($e);
return ErrorHandler::showDebug($e);
}
$layout_class = $this->getRouter()->getErrorLayout();