Commit d592f26
box/lua: implement inheritance of error payload fields
Suppose an error has a cause with some payload fields, for example:
local e1 = box.error.new{'e1', foo = 'bar'} -- cause
local e2 = box.error.new{'e2', prev = e1} -- effect
Now it is possible to access cause payload fields via e2 directly:
e2.foo -- 'bar'
While looking for a payload field with a given name, we always stop at
the topmost (closest to the effect) field. If there's a field with the
same name deeper in the stack it is masked.
Closes tarantool#9106
@TarantoolBot document
Title: Document inheritance of error payload fields
Product: Tarantool
Since: 3.1
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error_object/
[Link to the design document](https://www.notion.so/tarantool/Error-subsystem-improvements-90faa0a4714b4143abaf8bed2c10b2fc?pvs=4#c080fe2ac28b46c8b0eda7234a8852ce)1 parent 709938a commit d592f26
File tree
3 files changed
+23
-3
lines changed- changelogs/unreleased
- src/lua
- test/box-luatest
3 files changed
+23
-3
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
0 commit comments