$error
$error(message?) -> undefinedCompact type signature
<s?:x>Source: JSONata
Documentation
$error() always terminates evaluation by throwing an error. Use it when the mapping cannot continue and you want to raise a deliberate failure with an optional message.
This helper belongs to Diagnostics And Errors: unlike $warn(), $info(), or $trace(), it does not continue after recording a diagnostic. It stops execution.
Examples
Abort evaluation with an error
Input
null
Expression
$error("Unsupported plan")
Result
Error (code D3137): Unsupported plan