Each thread has its own currenterror dictionary, which is used by the error handling machinery to store error state.
Input(s) Op/Proc/Var Output(s) |
Description |
- newerror boolean |
Set to true during error handling. |
- errorname name |
Name of most recent error. |
- origin string/null |
Get origin of syntax error. |
- line number |
Get line number of syntax error. |
- column number |
Get column number of syntax error. |
- ostack stack |
ostack snapshot. |
- dstack stack |
dstack snaphot. |
- cstack stack |
cstack snaphot. |
- estack stack |
estack snapshot. |
- istack stack |
istack snapshot. |
onyx:0> `1 2 3}' cvx eval At line 1, column 5: Error $syntaxerror ostack: (1 2 3 `}') dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..3): 0: `1 2 3}' 1: --eval-- 2: -file- 3: --start-- onyx:5> currenterror $column get 1 sprint 5 onyx:5>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin cstack end 1 sprint () onyx:1>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin dstack end 1 sprint (-dict- -dict- -dict- -dict-) onyx:1>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin errorname end 1 sprint $undefined onyx:1>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin estack end 1 sprint (--start-- -file- x) onyx:1>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin istack end 1 sprint (0 0 0) onyx:1>
onyx:0> currenterror begin onyx:0> newerror 1 sprint false onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> newerror 1 sprint true onyx:1> $newerror false def onyx:1> newerror 1 sprint false onyx:1> resume onyx:1> y Error $undefined ostack: (x) dstack: (-dict- -dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: y 1: -file- 2: --start-- onyx:2> newerror 1 sprint true onyx:2>
onyx:0> `1 2 3}' cvx eval At line 1, column 5: Error $syntaxerror ostack: (1 2 3 `}') dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..3): 0: `1 2 3}' 1: --eval-- 2: -file- 3: --start-- onyx:5> currenterror $line get 1 sprint 1 onyx:5>
onyx:0> 1 2 3} At *stdin*:1:5: Error $syntaxerror ostack: (1 2 3 `}') dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..1): 0: -file- 1: --start-- onyx:5> currenterror $origin get 1 sprint `*stdin*' onyx:5>
onyx:0> x Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) cstack: () estack/istack trace (0..2): 0: x 1: -file- 2: --start-- onyx:1> currenterror begin ostack end 1 sprint () onyx:1>