mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
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;
|
namespace Icinga\Util;
|
||||||
|
|
||||||
use SplFileObject;
|
use SplFileObject;
|
||||||
|
use ErrorException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Icinga\Exception\NotWritableError;
|
use Icinga\Exception\NotWritableError;
|
||||||
|
|
||||||
@ -128,9 +129,9 @@ class File extends SplFileObject
|
|||||||
protected function setupErrorHandler()
|
protected function setupErrorHandler()
|
||||||
{
|
{
|
||||||
set_error_handler(
|
set_error_handler(
|
||||||
function ($errno, $errstr) {
|
function ($errno, $errstr, $errfile, $errline) {
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
throw new RuntimeException($errstr);
|
throw new ErrorException($errno, $errstr, $errfile, $errline);
|
||||||
},
|
},
|
||||||
E_WARNING
|
E_WARNING
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user