improved error report
This commit is contained in:
parent
f6ac379dc0
commit
5e375c0c13
@ -83,18 +83,26 @@ class ErrorHandler {
|
||||
// Build log message
|
||||
$errorTag = $this->getErrorTag($errorNumber);
|
||||
$userError = $this->isUserErrorNumber($errorNumber);
|
||||
|
||||
$traceString = null;
|
||||
$sourceClass = null;
|
||||
$traceSourceClass = null;
|
||||
$fileLine = null;
|
||||
|
||||
$message = $errorTag . ': ' . $errorString;
|
||||
$fileLine = $errorFile . ': ' . $errorLine;
|
||||
if (!$onShutdown) {
|
||||
$traceString = $this->parseBackTrace(array_slice(debug_backtrace(), 1), $traceSourceClass);
|
||||
}
|
||||
if ($errorFile) {
|
||||
$fileLine = $errorFile . ': ' . $errorLine;
|
||||
$sourceClass = $this->getSourceClass($errorFile);
|
||||
if (!$sourceClass) {
|
||||
}
|
||||
if (!$sourceClass && $traceSourceClass) {
|
||||
$sourceClass = $traceSourceClass;
|
||||
}
|
||||
|
||||
$logMessage = $message . PHP_EOL . 'File&Line: ' . $fileLine;
|
||||
if (!$userError && !$onShutdown) {
|
||||
if (!$userError && $traceString) {
|
||||
$logMessage .= PHP_EOL . 'Trace: ' . PHP_EOL . $traceString;
|
||||
}
|
||||
$this->maniaControl->log($logMessage);
|
||||
@ -104,10 +112,14 @@ class ErrorHandler {
|
||||
$report = array();
|
||||
$report['Type'] = 'Error';
|
||||
$report['Message'] = $message;
|
||||
if ($fileLine) {
|
||||
$report['FileLine'] = $fileLine;
|
||||
}
|
||||
if ($sourceClass) {
|
||||
$report['SourceClass'] = $sourceClass;
|
||||
$report['PluginId'] = PluginManager::getPluginId($sourceClass);
|
||||
if (!$onShutdown) {
|
||||
}
|
||||
if ($traceString) {
|
||||
$report['Backtrace'] = $traceString;
|
||||
}
|
||||
$report['OperatingSystem'] = php_uname();
|
||||
|
Loading…
Reference in New Issue
Block a user