mirror of
https://github.com/predis/predis.git
synced 2026-09-01 21:27:46 +00:00
fix(stream): Fixed throwing CommunicationException when stream is EOF (#1548)
* fix(stream): Fixed return type to match function signature * Updated CHANGELOG.md * Fix syntax error * Updated CHANGELOG.md entry
This commit is contained in:
committed by
GitHub
parent
6021daf9cd
commit
d7f60099a6
@@ -7,6 +7,7 @@
|
||||
### Fixed
|
||||
- Fixed PHP 8.4 deprecated call to `stream_context_set_option()` (#1545)
|
||||
- Fixed return type for `ZCOUNT` to be `int` (#1547)
|
||||
- fix(stream): Fixed throwing `CommunicationException` when stream is EOF (#1548)
|
||||
|
||||
## v3.0.1 (2025-05-16)
|
||||
### Fixed
|
||||
|
||||
@@ -145,7 +145,7 @@ class StreamConnection extends AbstractConnection
|
||||
$stream = $this->getResource();
|
||||
|
||||
if ($stream->eof()) {
|
||||
$this->onStreamError(new RuntimeException('Stream is already at the end'), '');
|
||||
$this->onStreamError(new RuntimeException('', 1), 'Stream is already at the end');
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Predis\Connection;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Predis\Client;
|
||||
use Predis\Command\RawCommand;
|
||||
use Predis\CommunicationException;
|
||||
use Predis\Connection\Resource\Exception\StreamInitException;
|
||||
use Predis\Connection\Resource\StreamFactoryInterface;
|
||||
use Predis\Consumer\Push\PushResponse;
|
||||
@@ -463,7 +464,7 @@ class StreamConnectionTest extends PredisConnectionTestCase
|
||||
|
||||
$connection = new StreamConnection($parameters, $this->mockStreamFactory);
|
||||
|
||||
$this->expectException(RuntimeException::class);
|
||||
$this->expectException(CommunicationException::class);
|
||||
$this->expectExceptionMessage('Stream is already at the end');
|
||||
|
||||
$connection->read();
|
||||
|
||||
Reference in New Issue
Block a user