Skip to content

Commit c170d0a

Browse files
committed
Add description of box.error.is function
Function allows check whether the argument is an error. Added as a new page Fixes #4236
1 parent 908ab26 commit c170d0a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

doc/reference/reference_lua/box_error.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ Below is a list of ``box.error`` functions and related objects.
275275

276276
* - :doc:`./box_error/set`
277277
- Set the specified error as the last system error explicitly
278+
279+
* - :doc:`./box_error/is`
280+
- Verify whether the specified argument is an error
278281

279282
* - :doc:`./box_error/error_object`
280283
- An object that defines an error
@@ -288,4 +291,5 @@ Below is a list of ``box.error`` functions and related objects.
288291
box_error/clear
289292
box_error/new
290293
box_error/set
294+
box_error/is
291295
box_error/error_object
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _box_error-is:
2+
3+
===============================================================================
4+
box.error.is()
5+
===============================================================================
6+
7+
.. function:: box.error.is(object_name)
8+
9+
**Since:** :doc:`3.2.0 </release/3.2.0>`
10+
11+
The ``box.error.is`` function allows verify whether the specified argument is an error.
12+
13+
:param object_name object_name: the subject of the request
14+
15+
**Return type:**
16+
boolean
17+
18+
**Example**
19+
20+
.. code-block:: lua
21+
tarantool> box.error.is(box.error.new(box.error.UNKNOWN))
22+
---
23+
- true
24+
...
25+
tarantool> box.error.is('foo')
26+
---
27+
- false
28+
...

0 commit comments

Comments
 (0)