fix: code execution node not display clear reasons when sandbox res error (#6830)

This commit is contained in:
非法操作 2024-08-02 15:36:44 +08:00 committed by GitHub
parent 62cc4077bb
commit bf3f1027c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,10 +108,10 @@ class CodeExecutor:
except: except:
raise CodeExecutionException('Failed to parse response') raise CodeExecutionException('Failed to parse response')
response = CodeExecutionResponse(**response) if (code := response.get('code')) != 0:
raise CodeExecutionException(f"Got error code: {code}. Got error msg: {response.get('message')}")
if response.code != 0: response = CodeExecutionResponse(**response)
raise CodeExecutionException(response.message)
if response.data.error: if response.data.error:
raise CodeExecutionException(response.data.error) raise CodeExecutionException(response.data.error)