From d39b7084cd8052fcba096bef0d887e43d05194e0 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 13 May 2011 15:42:38 -0500 Subject: [PATCH] Trying to carefully improve the language on a common exception message For example, if using Symfony, this is probably that first thing you'll see after installing, because the logs directory won't be writable. So, ideally, it should be clear enough that the user knows to change the permissions on the directory. Many developers might not understand the idea of a "stream", but they do understand a file not being writable. --- src/Monolog/Handler/StreamHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index 7ea58e73..b631d080 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -64,7 +64,7 @@ class StreamHandler extends AbstractProcessingHandler $this->stream = @fopen($this->url, 'a'); if (!is_resource($this->stream)) { $this->stream = null; - throw new \UnexpectedValueException('The stream could not be opened, "'.$this->url.'" may be an invalid url.'); + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened; it may be invalid or not writable.', $this->url)); } } fwrite($this->stream, (string) $record['message']);