From 76e748c483fb79efc134ef6b492b60131fec56c4 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" <alexander.klimov@netways.de> Date: Fri, 5 Jun 2015 17:12:32 +0200 Subject: [PATCH] Don't throw any exception refs #8705 --- library/Icinga/Application/Platform.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index a6e0d9604..cc72857f9 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -3,8 +3,6 @@ namespace Icinga\Application; -use Icinga\Exception\IcingaException; - /** * Platform tests for icingaweb */ @@ -95,7 +93,7 @@ class Platform foreach ($osRelease as $osInfo) { if (false === ($res = @preg_match('/(?<!.)[ \t]*#/ms', $osInfo))) { - throw new IcingaException('Failed at preg_match()'); + return false; } if ($res === 1) { continue; @@ -107,7 +105,7 @@ class Platform $osInfo, $matches ))) { - throw new IcingaException('Failed at preg_match()'); + return false; } if (! ($res === 0 || $matches[2] === '' || $matches[2] === 'linux')) { return $matches[2]; @@ -159,7 +157,7 @@ class Platform if ($reliable < 1) { if (false === ($procVersion = @file_get_contents('/proc/version'))) { - throw new IcingaException('Failed at file_get_contents(/proc/version)'); + return false; } $procVersion = strtolower($procVersion); foreach (array(