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)) {
throw new SystemPermissionException(
'Can not enable module "' . $name . '". '
. 'Insufficient system permissions for enabling modules.'
'Can not enable module "%s". Insufficient system permissions for enabling modules.',
$name
);
}
@ -232,9 +232,11 @@ class Manager
$error = error_get_last();
if (strstr($error["message"], "File exists") === false) {
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. '
. 'Primary error was: ' . $error['message']
. 'Primary error was: %s',
$name,
$error['message']
);
}
}
@ -287,9 +289,11 @@ class Manager
if (!@unlink($link)) {
$error = error_get_last();
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. '
. 'Primary error was: ' . $error['message']
. 'Primary error was: %s',
$name,
$error['message']
);
}
}

View File

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