From 764601c60648e7e1e4cf47e91e37e1059f8329be Mon Sep 17 00:00:00 2001 From: Thomas Praxl Date: Mon, 25 Nov 2019 12:01:34 +0100 Subject: [PATCH] Expect and document a more concrete exception type As was proposed during review. --- src/Monolog/Handler/StreamHandler.php | 2 +- tests/Monolog/Handler/StreamHandlerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index 9541556b..4cce3c39 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -32,7 +32,7 @@ class StreamHandler extends AbstractProcessingHandler private $dirCreated; /** - * @param resource|string $stream If a missing path can't be created, an Exception will be thrown on first write + * @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write * @param string|int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) diff --git a/tests/Monolog/Handler/StreamHandlerTest.php b/tests/Monolog/Handler/StreamHandlerTest.php index 96a2ff46..8e0d111f 100644 --- a/tests/Monolog/Handler/StreamHandlerTest.php +++ b/tests/Monolog/Handler/StreamHandlerTest.php @@ -203,7 +203,7 @@ class StreamHandlerTest extends TestCase ); } - $this->expectException(\Exception::class); + $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('There is no existing directory at'); $handler->handle($this->getRecord());