Skip to content

Commit 5695922

Browse files
committed
Updating docs for continue on failure feature
1 parent 8823b59 commit 5695922

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/source/features.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ To implement the same function for multiple step names (aka, step aliases), pass
3737
Continue on failure
3838
^^^^^^^^^^^^^^^^^^^
3939

40-
To have a particular step implementation not break execution dure to failure, use the ``@continue_on_failure`` decorator. For example:
40+
To have a particular step implementation not break execution due to failure, use the ``continue_on_failure`` decorator.
41+
42+
In the following example, the execution will continue if the error is an assertion error or its subclass otherwise it will halt the scenario execution.
4143

4244
::
4345

@@ -48,6 +50,17 @@ To have a particular step implementation not break execution dure to failure, us
4850
def hello(user_name):
4951
assert 2 == 1
5052

53+
The list of errors can be provided as a parameter to ``continue_on_failure`` decorator. It will continue the execution if the error is in the given list or the subclass of any errors mentioned. For example:
54+
55+
::
56+
57+
from getgauge.python import step, continue_on_failure
58+
59+
@continue_on_failure([AssertionError, RuntimeError])
60+
@step("Create a user <user name>")
61+
def hello(user_name):
62+
assert 2 == 1
63+
5164
Parameters
5265
^^^^^^^^^^
5366
Steps can be defined to take values as parameters so that they can be re-used with different parameter values.

0 commit comments

Comments
 (0)