Icinga\Util\File: throw an ErrorException with file and linenumber details

This commit is contained in:
Johannes Meyer 2014-06-27 09:53:50 +02:00
parent a4fc6dedea
commit 9c1ee57628
1 changed files with 3 additions and 2 deletions

View File

@ -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
);