SystemPermissionException: extend IcingaException

refs #6931
This commit is contained in:
Alexander Klimov 2014-08-26 11:21:57 +02:00
parent febb2d1ae2
commit a2011b1665
2 changed files with 11 additions and 9 deletions

View File

@ -219,8 +219,8 @@ class Manager
if (!is_writable($this->enableDir)) { if (!is_writable($this->enableDir)) {
throw new SystemPermissionException( throw new SystemPermissionException(
'Can not enable module "' . $name . '". ' 'Can not enable module "%s". Insufficient system permissions for enabling modules.',
. 'Insufficient system permissions for enabling modules.' $name
); );
} }
@ -232,9 +232,11 @@ class Manager
$error = error_get_last(); $error = error_get_last();
if (strstr($error["message"], "File exists") === false) { if (strstr($error["message"], "File exists") === false) {
throw new SystemPermissionException( throw new SystemPermissionException(
'Could not enable module "' . $name . '" due to file system errors. ' 'Could not enable module "%s" due to file system errors. '
. 'Please check path and mounting points because this is not a permission error. ' . 'Please check path and mounting points because this is not a permission error. '
. 'Primary error was: ' . $error['message'] . 'Primary error was: %s',
$name,
$error['message']
); );
} }
} }
@ -287,9 +289,11 @@ class Manager
if (!@unlink($link)) { if (!@unlink($link)) {
$error = error_get_last(); $error = error_get_last();
throw new SystemPermissionException( throw new SystemPermissionException(
'Could not disable module "' . $name . '" due to file system errors. ' 'Could not disable module "%s" due to file system errors. '
. 'Please check path and mounting points because this is not a permission error. ' . 'Please check path and mounting points because this is not a permission error. '
. 'Primary error was: ' . $error['message'] . 'Primary error was: %s',
$name,
$error['message']
); );
} }
} }

View File

@ -4,11 +4,9 @@
namespace Icinga\Exception; namespace Icinga\Exception;
use \Exception;
/** /**
* Handle problems according to file system permissions * Handle problems according to file system permissions
*/ */
class SystemPermissionException extends Exception class SystemPermissionException extends IcingaException
{ {
} }