perago.failed_result#

perago.failed_result(reason)[源代码]#

Build a failed worker attempt result.

The helper converts any runtime failure reason to Conductor's string reasonForIncompletion field and leaves output unset.

Parameters:
reasonobject

Failure reason converted with str for Conductor's reasonForIncompletion field.

Returns:
RuntimeTaskResult

Result with status "FAILED" and no output payload.

参数:

reason (object)

返回类型:

RuntimeTaskResult

参见

terminal_failed_result

Build a terminal failed result.

result_for_exception

Classify exceptions into result statuses.

Notes

Perago uses FAILED for 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'}