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)
|
||||
{
|
||||
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);
|
||||
Logger::debug(
|
||||
|
|
|
@ -173,10 +173,10 @@ class RemoteCommandFile implements CommandTransportInterface
|
|||
public function send(IcingaCommand $command, $now = null)
|
||||
{
|
||||
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)) {
|
||||
throw new LogicException;
|
||||
throw new LogicException('Can\'t send external Icinga Command. Remote host is missing');
|
||||
}
|
||||
$commandString = $this->renderer->render($command, $now);
|
||||
Logger::debug(
|
||||
|
|
Loading…
Reference in New Issue