Skip to content

Commit

Permalink
change error message to something more descriptive (All-Hands-AI#1790)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed May 15, 2024
1 parent 1353208 commit c604f8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion opendevin/runtime/server/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ async def read_file(path, workdir, start=0, end=-1) -> Observation:
try:
whole_path = resolve_path(path, workdir)
except PermissionError:
return ErrorObservation(f'Malformed paths not permitted: {path}')
return ErrorObservation(
f"You're not allowed to access this path: {path}. You can only access paths inside the workspace."
)

try:
with open(whole_path, 'r', encoding='utf-8') as file:
Expand Down

0 comments on commit c604f8f

Please sign in to comment.