Skip to content

Document custom error payload fields #4047

Open
@TarantoolBot

Description

@TarantoolBot

Related dev. issue(s): tarantool/tarantool#9104

Product: Tarantool
Since: 3.1
Root document:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions