monitoring: throw meaningful logic exceptions in the command file classes

This commit is contained in:
Eric Lippmann 2014-10-29 11:36:00 +01:00
parent 319c5e7833
commit 8ee52f8737
2 changed files with 3 additions and 3 deletions

View File

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

View File

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