mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
CommandUsage: do not throw ProgrammingError
This commit is contained in:
parent
e899a6723d
commit
f43c74dc8e
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Director\Resolver;
|
namespace Icinga\Module\Director\Resolver;
|
||||||
|
|
||||||
use Icinga\Exception\ProgrammingError;
|
|
||||||
use Icinga\Module\Director\Objects\IcingaCommand;
|
|
||||||
use dipl\Html\Link;
|
use dipl\Html\Link;
|
||||||
use dipl\Translation\TranslationHelper;
|
use dipl\Translation\TranslationHelper;
|
||||||
|
use Icinga\Module\Director\Objects\IcingaCommand;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
class CommandUsage
|
class CommandUsage
|
||||||
{
|
{
|
||||||
@ -20,12 +20,11 @@ class CommandUsage
|
|||||||
/**
|
/**
|
||||||
* CommandUsageTable constructor.
|
* CommandUsageTable constructor.
|
||||||
* @param IcingaCommand $command
|
* @param IcingaCommand $command
|
||||||
* @throws ProgrammingError
|
|
||||||
*/
|
*/
|
||||||
public function __construct(IcingaCommand $command)
|
public function __construct(IcingaCommand $command)
|
||||||
{
|
{
|
||||||
if ($command->isTemplate()) {
|
if ($command->isTemplate()) {
|
||||||
throw new ProgrammingError(
|
throw new InvalidArgumentException(
|
||||||
'CommandUsageTable expects object or external_object, got a template'
|
'CommandUsageTable expects object or external_object, got a template'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -36,7 +35,6 @@ class CommandUsage
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
* @throws ProgrammingError
|
|
||||||
*/
|
*/
|
||||||
public function getLinks()
|
public function getLinks()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user