mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
Throw NotFoundError instead of InvalidArgumentException in RoleForm::remove()
This commit is contained in:
parent
1135643fe1
commit
0681cd2782
@ -231,7 +231,7 @@ class RoleForm extends ConfigForm
|
|||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
* @throws LogicException If the config is not set
|
* @throws LogicException If the config is not set
|
||||||
* @throws InvalidArgumentException If the role does not exist
|
* @throws NotFoundError If the role does not exist
|
||||||
* @see ConfigForm::setConfig() For setting the config.
|
* @see ConfigForm::setConfig() For setting the config.
|
||||||
*/
|
*/
|
||||||
public function remove($name)
|
public function remove($name)
|
||||||
@ -240,10 +240,10 @@ class RoleForm extends ConfigForm
|
|||||||
throw new LogicException(sprintf('Can\'t remove role \'%s\'. Config is not set', $name));
|
throw new LogicException(sprintf('Can\'t remove 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 remove role \'%s\'. Role does not exist'),
|
$this->translate('Can\'t remove role \'%s\'. Role does not exist'),
|
||||||
$name
|
$name
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
$this->config->removeSection($name);
|
$this->config->removeSection($name);
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user