From 8ee52f873757f8e5eb613fc27387b5dfd9d48853 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 29 Oct 2014 11:36:00 +0100 Subject: [PATCH] monitoring: throw meaningful logic exceptions in the command file classes --- .../library/Monitoring/Command/Transport/LocalCommandFile.php | 2 +- .../Monitoring/Command/Transport/RemoteCommandFile.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php b/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php index 83c066e97..c3133d469 100644 --- a/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php +++ b/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php @@ -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( diff --git a/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php b/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php index 613e66a84..d22e2c863 100644 --- a/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php +++ b/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php @@ -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(