mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Throw NotFoundError instead of InvalidArgumentException in RoleForm::load()
This commit is contained in:
parent
c5d0094e8e
commit
13131cb3f6
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Forms\Security;
|
namespace Icinga\Forms\Security;
|
||||||
|
|
||||||
|
use Icinga\Exception\NotFoundError;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Zend_Form_Element;
|
use Zend_Form_Element;
|
||||||
@ -170,10 +171,10 @@ class RoleForm extends ConfigForm
|
|||||||
throw new LogicException(sprintf('Can\'t load role \'%s\'. Config is not set', $name));
|
throw new LogicException(sprintf('Can\'t load role \'%s\'. Config is not set', $name));
|
||||||
}
|
}
|
||||||
if (! $this->config->hasSection($name)) {
|
if (! $this->config->hasSection($name)) {
|
||||||
throw new InvalidArgumentException(sprintf(
|
throw new NotFoundError(
|
||||||
$this->translate('Can\'t load role \'%s\'. Role does not exist'),
|
$this->translate('Can\'t load role \'%s\'. Role does not exist'),
|
||||||
$name
|
$name
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
$role = $this->config->getSection($name)->toArray();
|
$role = $this->config->getSection($name)->toArray();
|
||||||
$role['permissions'] = ! empty($role['permissions'])
|
$role['permissions'] = ! empty($role['permissions'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user