mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-24 06:36:37 +00:00
updated
This commit is contained in:
parent
057ef9b05e
commit
73ab4559c3
@ -54,7 +54,10 @@ def execute_python(code, client:Client, message_id):
|
|||||||
# Check if the process was successful.
|
# Check if the process was successful.
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
# The child process threw an exception.
|
# The child process threw an exception.
|
||||||
error_message = f"Error executing Python code: {error.decode('utf8')}"
|
try:
|
||||||
|
error_message = f"Error executing Python code: {error.decode('utf8')}"
|
||||||
|
except:
|
||||||
|
error_message = f"Error executing Python code: {error}"
|
||||||
error_json = {"output": "<div class='text-red-500'>"+error_message+"</div>", "execution_time": execution_time}
|
error_json = {"output": "<div class='text-red-500'>"+error_message+"</div>", "execution_time": execution_time}
|
||||||
return error_json
|
return error_json
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user