error
Unconditionally fail, raising an exception, with an optional message.
Ends control flow, enabling one to write e.g.
function f(x: integer?): integer {
if (x == null) {
rell.error('null argument');
}
return x * x; // compiler knows that x cannot be null, so we can write x * x
}Content copied to clipboard
rell.error(message) is equivalent to require(false, message), except that rell.error() has the additional end-of-control-flow behaviour.
Since
0.14.15
Parameters
message
the message for the exception to be thrown
Throws
exception
unconditionally