diff --git a/doc/reference/reference_lua/box_error.rst b/doc/reference/reference_lua/box_error.rst index 7202ae13e5..abbc5733b5 100644 --- a/doc/reference/reference_lua/box_error.rst +++ b/doc/reference/reference_lua/box_error.rst @@ -275,6 +275,9 @@ Below is a list of ``box.error`` functions and related objects. * - :doc:`./box_error/set` - Set the specified error as the last system error explicitly + + * - :doc:`./box_error/is` + - Verify whether the specified argument is an error cdata object * - :doc:`./box_error/error_object` - An object that defines an error @@ -288,4 +291,5 @@ Below is a list of ``box.error`` functions and related objects. box_error/clear box_error/new box_error/set + box_error/is box_error/error_object diff --git a/doc/reference/reference_lua/box_error/error_object.rst b/doc/reference/reference_lua/box_error/error_object.rst index 93266c3e03..b2d151290a 100644 --- a/doc/reference/reference_lua/box_error/error_object.rst +++ b/doc/reference/reference_lua/box_error/error_object.rst @@ -189,3 +189,13 @@ error_object For the ``box.error.READONLY`` error, returns the current election term (see :ref:`box.info.election.term `). This attribute may present if the :ref:`error reason ` is ``election`` or ``synchro``. + + .. _box_error-name: + + .. data:: name + + **Since:** :doc:`3.1.0 ` + + Returns the name of the error. + + diff --git a/doc/reference/reference_lua/box_error/is.rst b/doc/reference/reference_lua/box_error/is.rst new file mode 100644 index 0000000000..6d0f2a62d9 --- /dev/null +++ b/doc/reference/reference_lua/box_error/is.rst @@ -0,0 +1,29 @@ +.. _box_error-is: + +=============================================================================== +box.error.is() +=============================================================================== + +.. function:: box.error.is(object) + + **Since:** :doc:`3.2.0 ` + + The ``box.error.is`` function allows verify whether the specified argument is an error cdata object. + + :param object object: the object to be verified. + + **Return type:** + boolean + + **Example** + + .. code-block:: lua + + tarantool> box.error.is(box.error.new(box.error.UNKNOWN)) + --- + - true + ... + tarantool> box.error.is('foo') + --- + - false + ... \ No newline at end of file