From fc5f02694275f1aab56494933fb4a35a4403ec94 Mon Sep 17 00:00:00 2001 From: tobitege <10787084+tobitege@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:05:38 +0200 Subject: [PATCH] prevent 500 server error on a just removed folder when listing files (#3553) --- openhands/runtime/client/client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openhands/runtime/client/client.py b/openhands/runtime/client/client.py index 1f070ad9e5..c21e72a827 100644 --- a/openhands/runtime/client/client.py +++ b/openhands/runtime/client/client.py @@ -605,10 +605,8 @@ if __name__ == '__main__': full_path = os.path.join(client.initial_pwd, path) if not os.path.exists(full_path): - return JSONResponse( - content={'error': f'Directory {full_path} does not exist'}, - status_code=400, - ) + # if user just removed a folder, prevent server error 500 in UI + return [] try: # Check if the directory exists