From c8151882f6559a072598e7b98a0978ead38c2407 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Sun, 1 Feb 2026 20:10:27 +0100 Subject: [PATCH] Throw package specific exceptions in CallbackStream --- src/Server/Transport/CallbackStream.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Server/Transport/CallbackStream.php b/src/Server/Transport/CallbackStream.php index 0b80edc3..72d74b69 100644 --- a/src/Server/Transport/CallbackStream.php +++ b/src/Server/Transport/CallbackStream.php @@ -11,6 +11,7 @@ namespace Mcp\Server\Transport; +use Mcp\Exception\RuntimeException; use Psr\Http\Message\StreamInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; @@ -115,12 +116,12 @@ public function isSeekable(): bool 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 { - throw new \RuntimeException('Stream is not seekable'); + throw new RuntimeException('Stream is not rewindable'); } public function isWritable(): bool @@ -130,7 +131,7 @@ public function isWritable(): bool public function write($string): int { - throw new \RuntimeException('Stream is not writable'); + throw new RuntimeException('Stream is not writable'); } public function isReadable(): bool