mirror of
https://github.com/langgenius/dify.git
synced 2026-03-19 13:47:37 +08:00
fix: code node dose not work as expected
This commit is contained in:
@ -101,7 +101,6 @@ class CodeNode(BaseNode):
|
||||
)
|
||||
|
||||
variables[variable] = value
|
||||
|
||||
# Run code
|
||||
try:
|
||||
result = CodeExecutor.execute_code(
|
||||
@ -109,15 +108,16 @@ class CodeNode(BaseNode):
|
||||
code=code,
|
||||
inputs=variables
|
||||
)
|
||||
except CodeExecutionException as e:
|
||||
|
||||
# Transform result
|
||||
result = self._transform_result(result, node_data.outputs)
|
||||
except (CodeExecutionException, ValueError) as e:
|
||||
return NodeRunResult(
|
||||
status=WorkflowNodeExecutionStatus.FAILED,
|
||||
inputs=variables,
|
||||
error=str(e)
|
||||
)
|
||||
|
||||
# Transform result
|
||||
result = self._transform_result(result, node_data.outputs)
|
||||
|
||||
return NodeRunResult(
|
||||
status=WorkflowNodeExecutionStatus.SUCCEEDED,
|
||||
inputs=variables,
|
||||
|
||||
Reference in New Issue
Block a user