Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/codegen/extensions/tools/relace_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ def relace_edit(codebase: Codebase, filepath: str, edit_snippet: str, api_key: O
"""
try:
file = codebase.get_file(filepath)
except ValueError:
msg = f"File not found: {filepath}"
raise FileNotFoundError(msg)
except ValueError as e:
return RelaceEditObservation(
status="error",
error=f"File not found: {filepath}",
filepath=filepath,
)

# Get the original content
original_content = file.content
Expand Down
Loading