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:
parent
f1c40b062f
commit
56af44727b
1 changed files with 1427 additions and 310 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue