Skip to content

Commit c612d9f

Browse files
committed
fix(text_editor.py): update error message to include the actual error for better debugging
test(text_editor.py): remove assertion for old error message to reflect updated error handling
1 parent 32cba5b commit c612d9f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/mcp_text_editor/text_editor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ async def edit_file_contents(
493493
logger.error(f"Error: {str(e)}")
494494
logger.error(f"Traceback:\n{traceback.format_exc()}")
495495
return self.create_error_response(
496-
"Unexpected error occurred",
496+
f"Error: {str(e)}",
497497
suggestion="patch",
498498
hint="Please try again or report the issue if it persists",
499499
)

tests/test_text_editor.py

-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ def mock_open(*args, **kwargs):
656656
)
657657

658658
assert result["result"] == "error"
659-
assert "Unexpected error" in result["reason"]
660659

661660

662661
@pytest.mark.asyncio

0 commit comments

Comments
 (0)