error
Throw an error.
Syntax
Section titled “Syntax”error(errMsg)error(msgId, errMsg)error(msgId, errMsg, v1, v2, ...)Description
Section titled “Description”Aborts execution and raises an error. The optional msgId (a string like 'MyComp:badInput') lets calling try/catch blocks discriminate among error sources. Variadic v1, v2, ... are formatted into the message via sprintf-style substitution.
Examples
Section titled “Examples”error('Input must be positive')error('MyApp:notFound', 'File %s not found', filename)See also
Section titled “See also”warning— Display a warning message.assert— Assert that a condition is true; throw an error if not.MException— Construct an exception object.throw— Throw a previously-constructed exception.