From 6a1602a4997478ce232190c5a916d74e89275b5b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 2 May 2014 11:19:35 +0200 Subject: [PATCH] Exception messages should be single-line strings fixes #6095 --- library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php b/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php index 250864679..dcd1f6ced 100644 --- a/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php +++ b/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php @@ -30,6 +30,7 @@ namespace Icinga\Protocol\Commandpipe\Transport; use Icinga\Logger\Logger; +use Icinga\Exception\ConfigurationError; /** * CommandPipe Transport class that writes to a file accessible by the filesystem @@ -66,7 +67,7 @@ class LocalPipe implements Transport Logger::debug('Attempting to send external icinga command %s to local command file ', $message, $this->path); $file = @fopen($this->path, $this->openMode); if (!$file) { - throw new \RuntimeException('Could not open icinga pipe at $file : ' . print_r(error_get_last(), true)); + throw new ConfigurationError(sprintf('Could not open icinga command pipe at "%s"', $this->path)); } fwrite($file, '[' . time() . '] ' . $message . PHP_EOL); Logger::debug('Writing [' . time() . '] ' . $message . PHP_EOL);