Private
Public Access
TIER-2 READ conductor/code_styleguides/error_handling.md end-to-end before Phase 3: refactor(mcp_client): migrate L191 _resolve_and_check to Result[T] (Phase 3 site 1)
Legacy _resolve_and_check (Path|None, str tuple) now delegates to _resolve_and_check_result (Result[Path]). The try/except Exception in the legacy function is REMOVED; the new Result variant captures the structured ErrorInfo (kind=INVALID_INPUT for path errors, kind=PERMISSION for allowlist denials). Error messages are propagated via ui_message(). Updated tests/test_py_struct_tools.py::test_mcp_dispatch_errors to accept the new 'permission' ErrorKind string instead of the legacy 'ACCESS DENIED' substring (the new format is more descriptive). Audit: mcp_client BC count 40 -> 39.
This commit is contained in:
@@ -141,4 +141,4 @@ def test_mcp_dispatch_errors(temp_py_file):
|
||||
|
||||
# Denied path
|
||||
result = mcp_client.dispatch("py_remove_def", {"path": "C:/windows/system32/cmd.exe", "name": "foo"})
|
||||
assert "ACCESS DENIED" in result
|
||||
assert "ACCESS DENIED" in result or "permission" in result or "not within the allowed paths" in result
|
||||
|
||||
Reference in New Issue
Block a user