it is now possible to write error! some_value to raise an error with a value
error! with no value will have a value of None.
An :errors SomeType declaration constrains what types of value can be raised from a function
If this declaration is not present, the type will be inferred from all errors within
if a try group has three sections (as opposed to the typical one or two sections):
the first section is the body of potentially-error-raising expressions to execute
the second section is an local variable identifier with optional type (like a parameter) to declare the local variable which will catch the raised error value.
the third section is the body of code to handle the error case, with the above "catch" local variable being within scope and available to use.
it is now possible to write
error! some_value
to raise an error with a valueerror!
with no value will have a value ofNone
.An
:errors SomeType
declaration constrains what types of value can be raised from a functionif a
try
group has three sections (as opposed to the typical one or two sections):This is a backwards-compatible change.