readded ignoring in error handling

This commit is contained in:
Steffen Schröder 2014-05-06 02:29:48 +02:00
parent 5562421f85
commit aac762c452

View File

@ -61,6 +61,7 @@ class ErrorHandler {
$error['Type'] = 'Exception'; $error['Type'] = 'Exception';
$error['Message'] = $message; $error['Message'] = $message;
$error['Class'] = $exceptionClass; $error['Class'] = $exceptionClass;
$error['FileLine'] = $ex->getFile() . ': ' . $ex->getLine();
$error['Backtrace'] = $traceString; $error['Backtrace'] = $traceString;
$error['OperatingSystem'] = php_uname(); $error['OperatingSystem'] = php_uname();
$error['PHPVersion'] = phpversion(); $error['PHPVersion'] = phpversion();
@ -129,6 +130,12 @@ class ErrorHandler {
* @return bool * @return bool
*/ */
public function handleError($errorNumber, $errorString, $errorFile = null, $errorLine = -1) { public function handleError($errorNumber, $errorString, $errorFile = null, $errorLine = -1) {
$userError = $this->isUserErrorNumber($errorNumber);
if (!$userError && error_reporting() === 0) {
return;
}
$errorTag = $this->getErrorTag($errorNumber); $errorTag = $this->getErrorTag($errorNumber);
$message = $errorTag . ': ' . $errorString; $message = $errorTag . ': ' . $errorString;
@ -138,7 +145,7 @@ class ErrorHandler {
$logMessage = $message . PHP_EOL . 'File&Line: ' . $fileLine . PHP_EOL . 'Trace: ' . $traceString; $logMessage = $message . PHP_EOL . 'File&Line: ' . $fileLine . PHP_EOL . 'Trace: ' . $traceString;
logMessage($logMessage); logMessage($logMessage);
if ($this->reportErrors && !$this->isUserErrorNumber($errorNumber)) { if ($this->reportErrors && !$userError) {
$error = array(); $error = array();
$error['Type'] = 'Error'; $error['Type'] = 'Error';
$error['Message'] = $message; $error['Message'] = $message;