mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
monitoring: throw meaningful logic exceptions in the command file classes
This commit is contained in:
parent
319c5e7833
commit
8ee52f8737
@ -109,7 +109,7 @@ class LocalCommandFile implements CommandTransportInterface
|
|||||||
public function send(IcingaCommand $command, $now = null)
|
public function send(IcingaCommand $command, $now = null)
|
||||||
{
|
{
|
||||||
if (! isset($this->path)) {
|
if (! isset($this->path)) {
|
||||||
throw new LogicException;
|
throw new LogicException('Can\'t send external Icinga Command. Path to the local command file is missing');
|
||||||
}
|
}
|
||||||
$commandString = $this->renderer->render($command, $now);
|
$commandString = $this->renderer->render($command, $now);
|
||||||
Logger::debug(
|
Logger::debug(
|
||||||
|
@ -173,10 +173,10 @@ class RemoteCommandFile implements CommandTransportInterface
|
|||||||
public function send(IcingaCommand $command, $now = null)
|
public function send(IcingaCommand $command, $now = null)
|
||||||
{
|
{
|
||||||
if (! isset($this->path)) {
|
if (! isset($this->path)) {
|
||||||
throw new LogicException;
|
throw new LogicException('Can\'t send external Icinga Command. Path to the remote command file is missing');
|
||||||
}
|
}
|
||||||
if (! isset($this->host)) {
|
if (! isset($this->host)) {
|
||||||
throw new LogicException;
|
throw new LogicException('Can\'t send external Icinga Command. Remote host is missing');
|
||||||
}
|
}
|
||||||
$commandString = $this->renderer->render($command, $now);
|
$commandString = $this->renderer->render($command, $now);
|
||||||
Logger::debug(
|
Logger::debug(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user