Skip to content

πŸ™Œ OpenHands: AI-Driven Development

change error message to something more descriptive (#1790)

Robert Brennanc604f8fcd21f
diff --git a/opendevin/runtime/server/files.py b/opendevin/runtime/server/files.py
index 1bc49a8c6a..a2c1e35b8c 100644
--- a/opendevin/runtime/server/files.py
+++ b/opendevin/runtime/server/files.py
@@ -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: