tarantool / tarantool/doc

Document custom error payload fields

Open
#4,047 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.1 errors
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Related dev. issue(s): https://github.com/tarantool/tarantool/issues/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 https://github.com/tarantool/tarantool/commit/eb2c6a4a4de8a958f07e5d4efc4453ded1c3026d.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two referenced box_error.new and box_error documentation pages. Update the displayed argument forms to include custom key-value payload fields and document the reserved built-in field names listed in the issue. Done means both root documents describe the Tarantool 3.1 behavior consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.