Skip to content

Commit

Permalink
fix(nodes): handle errors in question_classifier and parameter_extrac…
Browse files Browse the repository at this point in the history
…tor (#11927)

Signed-off-by: -LAN- <laipz8200@outlook.com>
  • Loading branch information
laipz8200 authored Dec 21, 2024
1 parent 810adb8 commit c07d9e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ def _run(self):
error=str(e),
metadata={},
)
except Exception as e:
return NodeRunResult(
status=WorkflowNodeExecutionStatus.FAILED,
inputs=inputs,
process_data=process_data,
outputs={"__is_success": 0, "__reason": "Failed to invoke model", "__error": str(e)},
error=str(e),
metadata={},
)

error = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ def _run(self):
},
llm_usage=usage,
)

except ValueError as e:
except Exception as e:
return NodeRunResult(
status=WorkflowNodeExecutionStatus.FAILED,
inputs=variables,
Expand Down

0 comments on commit c07d9e9

Please sign in to comment.