Exception messages should be single-line strings

fixes #6095
This commit is contained in:
Thomas Gelf 2014-05-02 11:19:35 +02:00
parent 6c698c1543
commit 6a1602a499
1 changed files with 2 additions and 1 deletions

View File

@ -30,6 +30,7 @@
namespace Icinga\Protocol\Commandpipe\Transport; namespace Icinga\Protocol\Commandpipe\Transport;
use Icinga\Logger\Logger; use Icinga\Logger\Logger;
use Icinga\Exception\ConfigurationError;
/** /**
* CommandPipe Transport class that writes to a file accessible by the filesystem * 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); Logger::debug('Attempting to send external icinga command %s to local command file ', $message, $this->path);
$file = @fopen($this->path, $this->openMode); $file = @fopen($this->path, $this->openMode);
if (!$file) { 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); fwrite($file, '[' . time() . '] ' . $message . PHP_EOL);
Logger::debug('Writing [' . time() . '] ' . $message . PHP_EOL); Logger::debug('Writing [' . time() . '] ' . $message . PHP_EOL);