Skip to content

Commit 5184198

Browse files
committed
Add missing handler for resource subscribe and unsubscribe
1 parent 5e935eb commit 5184198

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/Server/Session/FileSessionStore.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use Mcp\Server\NativeClock;
1717
use Psr\Clock\ClockInterface;
18-
use Symfony\Component\Uid\Exception\InvalidArgumentException;
1918
use Symfony\Component\Uid\Uuid;
2019

2120
/**
@@ -140,7 +139,7 @@ public function gc(): array
140139
@unlink($path);
141140
try {
142141
$deleted[] = Uuid::fromString($entry);
143-
} catch (InvalidArgumentException $e) {
142+
} catch (\InvalidArgumentException|\Throwable $e) {
144143
// ignore non-UUID file names
145144
}
146145
}
@@ -177,7 +176,7 @@ public function getAllSessionIds(): array
177176

178177
try {
179178
$sessionIds[] = Uuid::fromString($entry);
180-
} catch (InvalidArgumentException $e) {
179+
} catch (\InvalidArgumentException|\Throwable $e) {
181180
// ignore non-UUID sessions
182181
}
183182
}

src/Server/Session/Psr16StoreSession.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace Mcp\Server\Session;
1515

1616
use Psr\SimpleCache\CacheInterface;
17-
use Symfony\Component\Uid\Exception\InvalidArgumentException;
1817
use Symfony\Component\Uid\Uuid;
1918

2019
/**
@@ -106,7 +105,7 @@ public function getAllSessionIds(): array
106105
if ($this->exists($uuid)) {
107106
$validSessionIds[] = $uuid;
108107
}
109-
} catch (InvalidArgumentException $e) {
108+
} catch (\InvalidArgumentException|\Throwable $e) {
110109
// Skip invalid UUIDs
111110
}
112111
}

0 commit comments

Comments
 (0)