Language reference
Errors and exceptions
Catch runtime errors, inspect identifiers, and rethrow deliberately.
01
Handle a runtime error
Syntax and lexer errors occur before execution and cannot be caught. Runtime effects completed before an error are not rolled back.
try
result = inv([1, 2; 2, 4]);
catch failure
disp(failure.identifier);
disp(failure.message);
end02
Raise and rethrow
try
error("Plant:PressureHigh", "Pressure exceeded the limit");
catch failure
rethrow(failure);
end03
Current limits
Exception values expose read-only identifier and message fields. Stack traces, causes, finally, and native exception handling are not implemented.