Commit fc8b3015 authored by Taylor Otwell's avatar Taylor Otwell

Refactor the ignored error logging.

parent beb44eb4
...@@ -72,18 +72,17 @@ set_exception_handler(function($exception) use ($handler) ...@@ -72,18 +72,17 @@ set_exception_handler(function($exception) use ($handler)
* errors are ignored and errors in the developer configured whitelist * errors are ignored and errors in the developer configured whitelist
* are silently logged. * are silently logged.
*/ */
set_error_handler(function($number, $error, $file, $line) use ($logger) set_error_handler(function($code, $error, $file, $line) use ($logger)
{ {
if (error_reporting() === 0) if (error_reporting() === 0) return;
{
return; $exception = new \ErrorException($error, $code, 0, $file, $line);
}
$exception = new \ErrorException($error, $number, 0, $file, $line); if (in_array($code, Config::$items['error']['ignore']))
if (in_array($number, Config::$items['error']['ignore']))
{ {
$logger($exception); return $logger($exception);
return;
} }
throw $exception; throw $exception;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment