fix(python-run): prompt users to install Docker when execute_python_file encounters a Docker error (#2231)

fix(python-run): make error message more explicit

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
This commit is contained in:
Will Callender
2023-04-18 19:37:31 -04:00
committed by GitHub
parent e2accab87e
commit 74aa4add1b

View File

@@ -84,6 +84,12 @@ def execute_python_file(file: str) -> str:
return logs
except docker.errors.DockerException as e:
print(
"Could not run the script in a container. If you haven't already, please install Docker https://docs.docker.com/get-docker/"
)
return f"Error: {str(e)}"
except Exception as e:
return f"Error: {str(e)}"