Log MCPServer handler exceptions by kind and keep crash details off the wire (#3314)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
Max 2026-08-24 15:51:18 +01:00 • committed by GitHub
commit 56af44727b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -178,7 +178,7 @@ async def test_missing_file_error(temp_file: Path):
name="test",
path=missing,
)
with pytest.raises(ValueError, match="Error reading file"):
with pytest.raises(FileNotFoundError):
await resource.read()
@ -192,7 +192,7 @@ async def test_permission_error(temp_file: Path): # pragma: lax no cover
name="test",
path=temp_file,
)
with pytest.raises(ValueError, match="Error reading file"):
with pytest.raises(PermissionError):
await resource.read()
finally:
temp_file.chmod(0o644) # Restore permissions