Skip to content

Commit f40030b

Browse files
Update Docstring of FailureError
Co-authored-by: Dan Davison <[email protected]>
1 parent 5672e5c commit f40030b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

temporalio/exceptions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ def cause(self) -> Optional[BaseException]:
4141

4242

4343
class FailureError(TemporalError):
44-
"""Base for runtime failures during workflow/activity execution.
44+
"""Base class for exceptions that cause a workflow execution failure.
45+
46+
Do not raise this directly in workflow code: raise a child exception such as `ApplicationError` instead.
4547
46-
This is extended by ``ApplicationError``, which can be raised in a Workflow to fail the Workflow Execution.
47-
Workflow Execution Failures put the Workflow Execution into the "Failed" state and no more attempts will
48-
be made in progressing this execution.
48+
Workflow execution failure puts the workflow execution into "Failed" state, and no further attempts will
49+
be made to progress the workflow execution.
4950
50-
Any exception that does not extend this exception
51-
is considered a Workflow Task Failure. These types of failures will cause the Workflow Task to be retried.
51+
By default, any exception that does not extend this class causes the Workflow Task to be retried, rather than failing the workflow execution.
52+
53+
The default behavior can be changed by providing a list of exception types to ``workflow_failure_exception_types`` when creating a worker or ``failure_exception_types`` on the ``@workflow.defn`` decorator.
5254
"""
5355

5456
def __init__(

0 commit comments

Comments
 (0)