Skip to content

Commit 38c4616

Browse files
committed
Documentation enhancements
- Document the ERROR level under the Log levels section. - Clarify documentation related to logging with the ERROR level when `--exit-on-error` is enabled. - Explain that TRY/EXCEPT cannot catch errors stopping the whole execution. Fixes #5424.
1 parent 1d2acfa commit 38c4616

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

doc/userguide/src/CreatingTestData/ControlStructures.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,12 @@ they also mostly work the same way. A difference is that Python uses lower case
10401040
upper case letters. A bigger difference is that with Python exceptions are objects
10411041
and with Robot Framework you are dealing with error messages as strings.
10421042

1043+
.. note:: It is not possible to catch errors caused by invalid syntax or errors
1044+
that `stop the whole execution`__.
1045+
1046+
10431047
__ https://docs.python.org/tutorial/errors.html#handling-exceptions
1048+
__ `Stopping test execution gracefully`_
10441049

10451050
Catching exceptions with `EXCEPT`
10461051
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1117,8 +1122,6 @@ other `EXCEPT` branches:
11171122
Error Handler 2
11181123
END
11191124

1120-
.. note:: It is not possible to catch exceptions caused by invalid syntax.
1121-
11221125
Matching errors using patterns
11231126
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11241127

doc/userguide/src/ExecutingTestCases/OutputFiles.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,16 @@ log levels are:
268268
`FAIL`
269269
Used when a keyword fails. Can be used only by Robot Framework itself.
270270

271+
`ERROR`
272+
Used for displaying errors. Errors are shown in `the console and in
273+
the Test Execution Errors section in log files`__, but they
274+
do not affect test case statuses. If the `--exitonerror option is enabled`__,
275+
errors stop the whole execution, though,
276+
271277
`WARN`
272-
Used to display warnings. They shown also in `the console and in
278+
Used for displaying warnings. Warnings are shown in `the console and in
273279
the Test Execution Errors section in log files`__, but they
274-
do not affect the test case status.
280+
do not affect test case statuses.
275281

276282
`INFO`
277283
The default level for normal messages. By default,
@@ -289,6 +295,8 @@ log levels are:
289295

290296
__ `Logging information`_
291297
__ `Errors and warnings during execution`_
298+
__ `Stopping on parsing or execution error`_
299+
__ `Errors and warnings during execution`_
292300

293301
Setting log level
294302
~~~~~~~~~~~~~~~~~

doc/userguide/src/ExecutingTestCases/TestExecution.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,9 @@ fatal and execution stopped so that remaining tests are marked failed. With
692692
parsing errors encountered before execution even starts, this means that no
693693
tests are actually run.
694694

695-
When this option is enabled, using `ERROR` level in logs, such as `Log` keyword
696-
from BuiltIn or Python's standard logging module, will also fail the execution.
697-
Additionally, the TRY/EXCEPT stucture does not catch log messages with `ERROR`
698-
level, even when :option:`--exitonerror` is used.
695+
.. note:: Also logging something with the `ERROR` `log level`_ is considered
696+
an error and stops the execution if the :option:`--exitonerror` option
697+
is used.
699698

700699
__ `Errors and warnings during execution`_
701700

0 commit comments

Comments
 (0)