File: rs-script_error.rst

package info (click to toggle)
rsyslog-doc 8.2302.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,464 kB
  • sloc: python: 178; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
**************
script_error()
**************

Purpose
=======

script_error()

Returns the error state of functions that support it. C-Developers note that this
is similar to ``errno`` under Linux. The error state corresponds to the function
immediately called before. The next function call overrides it.

Right now, the value 0 means that that the previous functions succeeded, any other
value that it failed. In the future, we may have more fine-grain error codes.

Function descriptions mention if a function supports error state information. If not,
the function call will always set ``script_error()`` to 0.


Example
=======

The following example shows that script_error() only needs to be called and does
not need any parameters.

.. code-block:: none

   script_error()