Exceptions: Difference between revisions

→‎shortened catch: .err to _err
(→‎shortened catch: .err to _err)
Line 1,553:
 
=== shortened catch ===
A catch can be shortened by using a single expression that does not start with a variable name. This uses the implicit _err exception variable.err Prior to 0.7.0, the implicit exception variable was .err.
 
A shortened catch does not allow an else section (action for no exception).
Line 1,559:
<lang langur>100 / 0
 
catch if .err_err["cat"] == "math" {
# change result
123
890

edits