public function exceptionHandler(\Throwable $e, $trace = null)
{
if ($e === null) {
return;
}
global $lastError;
if ($trace === null) {
$trace = $e->getTrace();
}
$errstr = $e->getMessage();
$errfile = $e->getFile();
$errno = $e->getCode();
$errline = $e->getLine();
$type = ($errno === E_ERROR or $errno === E_USER_ERROR) ? \LogLevel::ERROR : (($errno === E_USER_WARNING or $errno === E_WARNING) ? \LogLevel::WARNING : \LogLevel::NOTICE);
if (($pos = strpos($errstr, "\n")) !== false) {
$errstr = substr($errstr, 0, $pos);
}
$errfile = cleanPath($errfile);
$this->logger->logException($e, $trace);
$lastError = ["type" => $type, "message" => $errstr, "fullFile" => $e->getFile(), "file" => $errfile, "line" => $errline, "trace" => @getTrace(1, $trace)];
global $lastExceptionError, $lastError;
$lastExceptionError = $lastError;
$this->crashDump();
}