raiseStaticError (message --)

Inputs

Outputs

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

Example: given error message

raiseStaticError fails compilation with the given message, reported at the call position and followed by the call chain.

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