perago.failed_result#
- perago.failed_result(reason)[源代码]#
Build a failed worker attempt result.
The helper converts any runtime failure reason to Conductor's string
reasonForIncompletionfield and leavesoutputunset.- Parameters:
- reasonobject
Failure reason converted with
strfor Conductor'sreasonForIncompletionfield.
- Returns:
- RuntimeTaskResult
Result with status
"FAILED"and nooutputpayload.
- 参数:
reason (object)
- 返回类型:
参见
terminal_failed_resultBuild a terminal failed result.
result_for_exceptionClassify exceptions into result statuses.
Notes
Perago uses
FAILEDfor most runtime errors, including post guardrail, stale attempt, publish fence, and task body failures.Examples
>>> failed_result("post guardrail failed").conductor_payload() {'status': 'FAILED', 'reasonForIncompletion': 'post guardrail failed'}