Skip to content

Provide error details through payload fields #4126

Open
@TarantoolBot

Description

@TarantoolBot

Related dev. issue(s): tarantool/tarantool#9108, tarantool/tarantool#6166

Product: Tarantool
Since: 3.1
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/
SME: @ nshy

Details

Now Tarantool error details are available as payload fields (which
in turn can be accessed as error object fields). For example:

tarantool> e = box.error.new(box.error.SPACE_EXISTS, 'some space')
tarantool> e.message
---
- Space 'some space' already exists
...
tarantool> e.space
---
- some space
...

One can introspect the details using error:unpack():

tarantool> e:unpack()

  • space: some space
    code: 10
    base_type: ClientError
    type: ClientError
    message: Space 'some space' already exists
    trace:

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.1errorsreference[location] Tarantool manual, Reference part

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions