Skip to content

Commit fc5f026

Browse files
authored
prevent 500 server error on a just removed folder when listing files (#3553)
1 parent 8d47ceb commit fc5f026

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

openhands/runtime/client/client.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,8 @@ async def list_files(request: Request):
605605
full_path = os.path.join(client.initial_pwd, path)
606606

607607
if not os.path.exists(full_path):
608-
return JSONResponse(
609-
content={'error': f'Directory {full_path} does not exist'},
610-
status_code=400,
611-
)
608+
# if user just removed a folder, prevent server error 500 in UI
609+
return []
612610

613611
try:
614612
# Check if the directory exists

0 commit comments

Comments
 (0)