Open
Description
Related dev. issue(s): tarantool/tarantool#9104
Product: Tarantool
Since: 3.1
Root document:
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/new/
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error/
SME: @ Gumix
Details
Since Tarantool 3.1 it is possible to add a custom payload to the error on
error construction. The payload is passed as key-value pairs, where key
is a string, and value
is any Lua object. The key name can be arbitrary
except it should not be the same as any of the built-in error field name:
reason, code, type, base_type, custom_type, errno, message, prev, trace.
Replace:
box.error.new({ reason = string[, code = number, type = string] }])
with:
box.error.new({ reason = string[, code = number, type = string, key1 = value1, ...] }])
Replace:
box.error({ reason = string[, code = number, type = string] }])
with:
box.error({ reason = string[, code = number, type = string, key1 = value1, ...] }])
Requested by @ Gumix in tarantool/tarantool@eb2c6a4.