send_task_failure
¶
send_task_failure(
task_token: TaskToken,
*,
config_overrides: Optional[SFNClientConfig] = None,
error: Optional[SensitiveError] = None,
cause: Optional[SensitiveCause] = None,
) -> SendTaskFailureOutput
Used by activity workers, Task states using the callback pattern, and optionally Task states using the job run pattern to report that the task identified by the taskToken failed.
For an execution with encryption enabled, Step Functions will encrypt the error and cause fields using the KMS key for the execution role.
A caller can mark a task as fail without using any KMS permissions in the execution role if the caller provides a null value for both error and cause fields because no data needs to be encrypted.
Parameters:
-
task_token(TaskToken) –The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the context object when a workflow enters a task state. See GetActivityTaskOutput$taskToken.
-
error(Optional[SensitiveError], default:None) –The error code of the failure.
-
cause(Optional[SensitiveCause], default:None) –A more detailed explanation of the cause of the failure.
Raises:
-
InvalidToken–The provided token is not valid.
-
KmsAccessDeniedException–Either your KMS key policy or API caller does not have the required permissions.
-
KmsInvalidStateException–The KMS key is not in valid state, for example: Disabled or Deleted.
-
KmsThrottlingException–Received when KMS returns
ThrottlingExceptionfor a KMS call that Step Functions makes on behalf of the caller. -
TaskDoesNotExist–The activity does not exist.
-
TaskTimedOut–The task token has either expired or the task associated with the token has already been closed.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sfn/_services/sfn.py
1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 | |