box/lua: allow to set custom error payload fields
See the docbot request for details. Closes #9104 @TarantoolBot document Title: Document custom error payload fields Product: Tarantool Since: 3.1 Root documents: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/new/ and https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error/ 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. NO_WRAP 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, ...] }]) NO_WRAP
Showing
- changelogs/unreleased/gh-9104-allow-to-set-error-payload.md 3 additions, 0 deletionschangelogs/unreleased/gh-9104-allow-to-set-error-payload.md
- src/box/lua/error.cc 58 additions, 2 deletionssrc/box/lua/error.cc
- test/box-luatest/error_subsystem_improvements_test.lua 81 additions, 0 deletionstest/box-luatest/error_subsystem_improvements_test.lua
Loading
Please register or sign in to comment