throw

The throw keyword throws an exception.

Purpose

This statement is used in the action part of rules or in functions to throw an exception that makes control flow immediately to an exception handler.

Syntax

throw 
expression

Description

The throw statement requires a single expression that is a throwable object. Throwable objects are instances of any subclass of the Java™ Throwable class.

The exception in the throw statement is not the exception actually thrown. The thrown exception is an instance of the EngineExecutionException class, which encapsulates the exception thrown in the throw statement.

Example

throw new java.lang.NullPointerException();