Document custom error payload fields
Nobody has claimed this yet.
- 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:
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/new/
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error/
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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