/**
* Handle an error event. Called by error handler and exception handler.
* @param string $type error type : 'error', 'warning', 'notice'
* @param integer $code error code
* @param string $message error message
* @param string $file the file name where the error appear
* @param integer $line the line number where the error appear
* @param array $trace the stack trace
* @since 1.1
*/
public function handleError($type, $code, $message, $file, $line, $trace)
{
$errorLog = new \Jelix\Logger\Message\Error($type, $code, $message, $file, $line, $trace);
$errorLog->setFormat(App::config()->error_handling['messageLogFormat']);
\Jelix\Logger\Log::log($errorLog, $type);
// if non fatal error, it is finished, continue the execution of the action
if ($type != 'error') {
return;
}
$this->errorMessage = $errorLog;
while (ob_get_level() && @ob_end_clean()) {
}
$resp = $this->request->getErrorResponse($this->response);
$resp->outputErrors();
\jSession::end();
exit(1);
}