Skip to content
Snippets Groups Projects
Commit 7410a4f0 authored by Nikolay Shirokovskiy's avatar Nikolay Shirokovskiy Committed by Vladimir Davydov
Browse files

box: add payload info for client error codes

So that error details are added as error payload. Now client don't need
to parse error message to get details.

box/error.test is changed to pass checkpatch. It is reported 'bla bla'
as possibly repeated word.

Closes #9108
Closes #6166

@TarantoolBot document
Title: Provide error details through payload fields
Product: Tarantool
Since: 3.1

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
...
parent 8227e379
No related branches found
No related tags found
No related merge requests found
Showing
with 294 additions and 265 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment