Throw package specific exceptions in CallbackStream (#233)
This commit is contained in:
parent
9621039e54
commit
6503059a4b
1 changed files with 4 additions and 3 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
namespace Mcp\Server\Transport;
|
namespace Mcp\Server\Transport;
|
||||||
|
|
||||||
|
use Mcp\Exception\RuntimeException;
|
||||||
use Psr\Http\Message\StreamInterface;
|
use Psr\Http\Message\StreamInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
|
|
@ -115,12 +116,12 @@ final class CallbackStream implements \Stringable, StreamInterface
|
||||||
|
|
||||||
public function seek($offset, $whence = \SEEK_SET): void
|
public function seek($offset, $whence = \SEEK_SET): void
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('Stream is not seekable');
|
throw new RuntimeException('Stream is not seekable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rewind(): void
|
public function rewind(): void
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('Stream is not seekable');
|
throw new RuntimeException('Stream is not rewindable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isWritable(): bool
|
public function isWritable(): bool
|
||||||
|
|
@ -130,7 +131,7 @@ final class CallbackStream implements \Stringable, StreamInterface
|
||||||
|
|
||||||
public function write($string): int
|
public function write($string): int
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('Stream is not writable');
|
throw new RuntimeException('Stream is not writable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isReadable(): bool
|
public function isReadable(): bool
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue