From 9c1ee5762825ecea92fb618dc91733be4d6283ac Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 27 Jun 2014 09:53:50 +0200 Subject: [PATCH] Icinga\Util\File: throw an ErrorException with file and linenumber details --- library/Icinga/Util/File.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Util/File.php b/library/Icinga/Util/File.php index 38bb2a0de..b7aff9743 100644 --- a/library/Icinga/Util/File.php +++ b/library/Icinga/Util/File.php @@ -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 );