Icinga\Util\File: throw an ErrorException with file and linenumber details
This commit is contained in:
parent
a4fc6dedea
commit
9c1ee57628
|
@ -5,6 +5,7 @@
|
|||
namespace Icinga\Util;
|
||||
|
||||
use SplFileObject;
|
||||
use ErrorException;
|
||||
use RuntimeException;
|
||||
use Icinga\Exception\NotWritableError;
|
||||
|
||||
|
@ -128,9 +129,9 @@ class File extends SplFileObject
|
|||
protected function setupErrorHandler()
|
||||
{
|
||||
set_error_handler(
|
||||
function ($errno, $errstr) {
|
||||
function ($errno, $errstr, $errfile, $errline) {
|
||||
restore_error_handler();
|
||||
throw new RuntimeException($errstr);
|
||||
throw new ErrorException($errno, $errstr, $errfile, $errline);
|
||||
},
|
||||
E_WARNING
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue