From 140dd873f184827d9815eb3cf72255e45d358f9e Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Mon, 27 May 2024 18:06:15 +0800 Subject: [PATCH] fix: show exception message when sandbox execution fails (#4663) --- api/core/helper/code_executor/code_executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/core/helper/code_executor/code_executor.py b/api/core/helper/code_executor/code_executor.py index bc92dde17..37573c88c 100644 --- a/api/core/helper/code_executor/code_executor.py +++ b/api/core/helper/code_executor/code_executor.py @@ -99,7 +99,9 @@ class CodeExecutor: except CodeExecutionException as e: raise e except Exception as e: - raise CodeExecutionException('Failed to execute code, this is likely a network issue, please check if the sandbox service is running') + raise CodeExecutionException('Failed to execute code, which is likely a network issue,' + ' please check if the sandbox service is running.' + f' ( Error: {str(e)} )') try: response = response.json()