Răsfoiți Sursa

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.
Ryan Weaver 14 ani în urmă
părinte
comite
d39b7084cd
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/Monolog/Handler/StreamHandler.php

+ 1 - 1
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']);