Open
Description
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:- file: '[string "e = box.error.new(box.error.SPACE_EXISTS, ''so..."]'
line: 1
...
Requested by @ nshy in tarantool/tarantool@7410a4f.
- file: '[string "e = box.error.new(box.error.SPACE_EXISTS, ''so..."]'