CommandUsage: do not throw ProgrammingError

This commit is contained in:
Thomas Gelf 2018-10-30 16:41:19 +01:00
parent e899a6723d
commit f43c74dc8e

View File

@ -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()
{ {