raiseStaticError (message --)
Inputs
Outputs
- None.
This builtin takes one known Text input and has no outputs. After the message is validated, compilation fails unconditionally.
The reported error text is the supplied message.
Behavior
- A known
NILText input is invalid.
Example
test.mpl
{} 0 {} [
"custom message" raiseStaticError
0
] "main" exportFunction
Expected Compilation Error
test.mpl(2,20): «raiseStaticError», custom message
test.mpl(4,10): «exportFunction», Called from here
See also
failCompilationbuiltin(--)Aborts compilation immediately.getCallTracebuiltin(-- callTrace)Returns a Ref to the current call trace, orNILwhen unavailable.printCompilerMessagebuiltin(message --)Prints a known Text message during compilation and appends one line-feed character.printStackbuiltin(--)Prints the current data stack in canonical formatter form; it does not itself pop stack objects.printStackTracebuiltin(--)Prints the current scope stack as file path, line, column, and node source text information.